LaunchConfiguration.fromXml constructor

LaunchConfiguration.fromXml(
  1. XmlElement elem
)

Implementation

factory LaunchConfiguration.fromXml(_s.XmlElement elem) {
  return LaunchConfiguration(
    createdTime: _s.extractXmlDateTimeValue(elem, 'CreatedTime')!,
    imageId: _s.extractXmlStringValue(elem, 'ImageId')!,
    instanceType: _s.extractXmlStringValue(elem, 'InstanceType')!,
    launchConfigurationName:
        _s.extractXmlStringValue(elem, 'LaunchConfigurationName')!,
    associatePublicIpAddress:
        _s.extractXmlBoolValue(elem, 'AssociatePublicIpAddress'),
    blockDeviceMappings: _s.extractXmlChild(elem, 'BlockDeviceMappings')?.let(
        (elem) => elem
            .findElements('member')
            .map((c) => BlockDeviceMapping.fromXml(c))
            .toList()),
    classicLinkVPCId: _s.extractXmlStringValue(elem, 'ClassicLinkVPCId'),
    classicLinkVPCSecurityGroups: _s
        .extractXmlChild(elem, 'ClassicLinkVPCSecurityGroups')
        ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')),
    ebsOptimized: _s.extractXmlBoolValue(elem, 'EbsOptimized'),
    iamInstanceProfile: _s.extractXmlStringValue(elem, 'IamInstanceProfile'),
    instanceMonitoring: _s
        .extractXmlChild(elem, 'InstanceMonitoring')
        ?.let((e) => InstanceMonitoring.fromXml(e)),
    kernelId: _s.extractXmlStringValue(elem, 'KernelId'),
    keyName: _s.extractXmlStringValue(elem, 'KeyName'),
    launchConfigurationARN:
        _s.extractXmlStringValue(elem, 'LaunchConfigurationARN'),
    metadataOptions: _s
        .extractXmlChild(elem, 'MetadataOptions')
        ?.let((e) => InstanceMetadataOptions.fromXml(e)),
    placementTenancy: _s.extractXmlStringValue(elem, 'PlacementTenancy'),
    ramdiskId: _s.extractXmlStringValue(elem, 'RamdiskId'),
    securityGroups: _s
        .extractXmlChild(elem, 'SecurityGroups')
        ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')),
    spotPrice: _s.extractXmlStringValue(elem, 'SpotPrice'),
    userData: _s.extractXmlStringValue(elem, 'UserData'),
  );
}