Chilkat Online Tools

GetImage Swift3 Example

EC2 Image Builder

func chilkatTest() {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let rest = CkoRest()!
    var success: Bool

    let authAws = CkoAuthAws()!
    authAws.accessKey = "AWS_ACCESS_KEY"
    authAws.secretKey = "AWS_SECRET_KEY"

    // Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
    authAws.region = "us-west-2"
    authAws.serviceName = "imagebuilder"
    // SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    rest.setAuthAws(authAws)

    // URL: https://imagebuilder.us-west-2.amazonaws.com/
    // Use the same region as specified above.
    success = rest.connect("imagebuilder.us-west-2.amazonaws.com", port: 443, tls: true, autoReconnect: true)
    if success != true {
        print("ConnectFailReason: \(rest.connectFailReason.intValue)")
        print("\(rest.lastErrorText!)")
        return
    }

    rest.addHeader("Content-Type", value: "application/x-amz-json-1.1")
    rest.addHeader("X-Amz-Target", value: "GetImage")

    let sbResponseBody = CkoStringBuilder()!
    success = rest.fullRequestNoBodySb("GET", uriPath: "/GetImage", sb: sbResponseBody)
    if success != true {
        print("\(rest.lastErrorText!)")
        return
    }

    var respStatusCode: Int = rest.responseStatusCode.intValue
    print("response status code = \(respStatusCode)")
    if respStatusCode != 200 {
        print("Response Header:")
        print("\(rest.responseHeader!)")
        print("Response Body:")
        print("\(sbResponseBody.getAsString()!)")
        return
    }

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)

    // The following code parses the JSON response.
    // A sample JSON response is shown below the sample code.

    // Use this online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    var componentArn: String?
    var j: Int
    var count_j: Int
    var name: String?
    var k: Int
    var count_k: Int
    var strVal: String?
    var deviceName: String?
    var DeleteOnTermination: Int
    var ebsEncrypted: Int
    var Iops: Int
    var ebsKmsKeyId: String?
    var SnapshotId: String?
    var Throughput: Int
    var VolumeSize: Int
    var VolumeType: String?
    var noDevice: String?
    var virtualName: String?
    var AmiTagsString: String?
    var amiDistributionConfigurationDescription: String?
    var amiDistributionConfigurationKmsKeyId: String?
    var amiDistributionConfigurationName: String?
    var containerDistributionConfigurationDescription: String?
    var TargetRepositoryRepositoryName: String?
    var TargetRepositoryService: String?
    var region: String?
    var DiskImageFormat: String?
    var RoleName: String?
    var S3Bucket: String?
    var S3Prefix: String?
    var accountId: String?
    var enabled: Int
    var LaunchTemplateId: String?
    var LaunchTemplateName: String?
    var LaunchTemplateVersion: String?
    var maxParallelLaunches: Int
    var TargetResourceCount: Int
    var launchTemplateId: String?
    var setDefaultVersion: Int
    var ebsDeleteOnTermination: Int
    var ebsIops: Int
    var ebsSnapshotId: String?
    var ebsThroughput: Int
    var ebsVolumeSize: Int
    var ebsVolumeType: String?
    var description: String?
    var image: String?
    var stateReason: String?
    var stateStatus: String?

    var Arn: String? = jResp.string(of: "image.arn")
    var BuildType: String? = jResp.string(of: "image.buildType")
    var ContainerRecipeArn: String? = jResp.string(of: "image.containerRecipe.arn")
    var ContainerType: String? = jResp.string(of: "image.containerRecipe.containerType")
    var DateCreated: String? = jResp.string(of: "image.containerRecipe.dateCreated")
    var Description: String? = jResp.string(of: "image.containerRecipe.description")
    var DockerfileTemplateData: String? = jResp.string(of: "image.containerRecipe.dockerfileTemplateData")
    var Encrypted: Int = jResp.int(of: "image.containerRecipe.encrypted").intValue
    var Image: String? = jResp.string(of: "image.containerRecipe.instanceConfiguration.image")
    var KmsKeyId: String? = jResp.string(of: "image.containerRecipe.kmsKeyId")
    var Name: String? = jResp.string(of: "image.containerRecipe.name")
    var Owner: String? = jResp.string(of: "image.containerRecipe.owner")
    var ParentImage: String? = jResp.string(of: "image.containerRecipe.parentImage")
    var Platform: String? = jResp.string(of: "image.containerRecipe.platform")
    var v_String: String? = jResp.string(of: "image.containerRecipe.tags.string")
    var RepositoryName: String? = jResp.string(of: "image.containerRecipe.targetRepository.repositoryName")
    var Service: String? = jResp.string(of: "image.containerRecipe.targetRepository.service")
    var Version: String? = jResp.string(of: "image.containerRecipe.version")
    var WorkingDirectory: String? = jResp.string(of: "image.containerRecipe.workingDirectory")
    var imageDateCreated: String? = jResp.string(of: "image.dateCreated")
    var DistributionConfigurationArn: String? = jResp.string(of: "image.distributionConfiguration.arn")
    var DistributionConfigurationDateCreated: String? = jResp.string(of: "image.distributionConfiguration.dateCreated")
    var DateUpdated: String? = jResp.string(of: "image.distributionConfiguration.dateUpdated")
    var DistributionConfigurationDescription: String? = jResp.string(of: "image.distributionConfiguration.description")
    var DistributionConfigurationName: String? = jResp.string(of: "image.distributionConfiguration.name")
    var TagsString: String? = jResp.string(of: "image.distributionConfiguration.tags.string")
    var TimeoutMinutes: Int = jResp.int(of: "image.distributionConfiguration.timeoutMinutes").intValue
    var EnhancedImageMetadataEnabled: Int = jResp.int(of: "image.enhancedImageMetadataEnabled").intValue
    var UninstallAfterBuild: Int = jResp.int(of: "image.imageRecipe.additionalInstanceConfiguration.systemsManagerAgent.uninstallAfterBuild").intValue
    var UserDataOverride: String? = jResp.string(of: "image.imageRecipe.additionalInstanceConfiguration.userDataOverride")
    var ImageRecipeArn: String? = jResp.string(of: "image.imageRecipe.arn")
    var ImageRecipeDateCreated: String? = jResp.string(of: "image.imageRecipe.dateCreated")
    var ImageRecipeDescription: String? = jResp.string(of: "image.imageRecipe.description")
    var ImageRecipeName: String? = jResp.string(of: "image.imageRecipe.name")
    var ImageRecipeOwner: String? = jResp.string(of: "image.imageRecipe.owner")
    var ImageRecipeParentImage: String? = jResp.string(of: "image.imageRecipe.parentImage")
    var ImageRecipePlatform: String? = jResp.string(of: "image.imageRecipe.platform")
    TagsString = jResp.string(of: "image.imageRecipe.tags.string")
    var v_Type: String? = jResp.string(of: "image.imageRecipe.type")
    var ImageRecipeVersion: String? = jResp.string(of: "image.imageRecipe.version")
    var ImageRecipeWorkingDirectory: String? = jResp.string(of: "image.imageRecipe.workingDirectory")
    var ImageTestsEnabled: Int = jResp.int(of: "image.imageTestsConfiguration.imageTestsEnabled").intValue
    var ImageTestsConfigurationTimeoutMinutes: Int = jResp.int(of: "image.imageTestsConfiguration.timeoutMinutes").intValue
    var InfrastructureConfigurationArn: String? = jResp.string(of: "image.infrastructureConfiguration.arn")
    var InfrastructureConfigurationDateCreated: String? = jResp.string(of: "image.infrastructureConfiguration.dateCreated")
    var InfrastructureConfigurationDateUpdated: String? = jResp.string(of: "image.infrastructureConfiguration.dateUpdated")
    var InfrastructureConfigurationDescription: String? = jResp.string(of: "image.infrastructureConfiguration.description")
    var HttpPutResponseHopLimit: Int = jResp.int(of: "image.infrastructureConfiguration.instanceMetadataOptions.httpPutResponseHopLimit").intValue
    var HttpTokens: String? = jResp.string(of: "image.infrastructureConfiguration.instanceMetadataOptions.httpTokens")
    var InstanceProfileName: String? = jResp.string(of: "image.infrastructureConfiguration.instanceProfileName")
    var KeyPair: String? = jResp.string(of: "image.infrastructureConfiguration.keyPair")
    var S3BucketName: String? = jResp.string(of: "image.infrastructureConfiguration.logging.s3Logs.s3BucketName")
    var S3KeyPrefix: String? = jResp.string(of: "image.infrastructureConfiguration.logging.s3Logs.s3KeyPrefix")
    var InfrastructureConfigurationName: String? = jResp.string(of: "image.infrastructureConfiguration.name")
    var ResourceTagsString: String? = jResp.string(of: "image.infrastructureConfiguration.resourceTags.string")
    var SnsTopicArn: String? = jResp.string(of: "image.infrastructureConfiguration.snsTopicArn")
    var SubnetId: String? = jResp.string(of: "image.infrastructureConfiguration.subnetId")
    TagsString = jResp.string(of: "image.infrastructureConfiguration.tags.string")
    var TerminateInstanceOnFailure: Int = jResp.int(of: "image.infrastructureConfiguration.terminateInstanceOnFailure").intValue
    var imageName: String? = jResp.string(of: "image.name")
    var OsVersion: String? = jResp.string(of: "image.osVersion")
    var imagePlatform: String? = jResp.string(of: "image.platform")
    var SourcePipelineArn: String? = jResp.string(of: "image.sourcePipelineArn")
    var SourcePipelineName: String? = jResp.string(of: "image.sourcePipelineName")
    var Reason: String? = jResp.string(of: "image.state.reason")
    var Status: String? = jResp.string(of: "image.state.status")
    TagsString = jResp.string(of: "image.tags.string")
    var imageType: String? = jResp.string(of: "image.type")
    var imageVersion: String? = jResp.string(of: "image.version")
    var requestId: String? = jResp.string(of: "requestId")
    var i: Int = 0
    var count_i: Int = jResp.size(ofArray: "image.containerRecipe.components").intValue
    while i < count_i {
        jResp.i = i
        componentArn = jResp.string(of: "image.containerRecipe.components[i].componentArn")
        j = 0
        count_j = jResp.size(ofArray: "image.containerRecipe.components[i].parameters").intValue
        while j < count_j {
            jResp.j = j
            name = jResp.string(of: "image.containerRecipe.components[i].parameters[j].name")
            k = 0
            count_k = jResp.size(ofArray: "image.containerRecipe.components[i].parameters[j].value").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "image.containerRecipe.components[i].parameters[j].value[k]")
                k = k + 1
            }

            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.containerRecipe.instanceConfiguration.blockDeviceMappings").intValue
    while i < count_i {
        jResp.i = i
        deviceName = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].deviceName")
        DeleteOnTermination = jResp.int(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.deleteOnTermination").intValue
        ebsEncrypted = jResp.int(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.encrypted").intValue
        Iops = jResp.int(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.iops").intValue
        ebsKmsKeyId = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.kmsKeyId")
        SnapshotId = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.snapshotId")
        Throughput = jResp.int(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.throughput").intValue
        VolumeSize = jResp.int(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeSize").intValue
        VolumeType = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeType")
        noDevice = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].noDevice")
        virtualName = jResp.string(of: "image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].virtualName")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.distributionConfiguration.distributions").intValue
    while i < count_i {
        jResp.i = i
        AmiTagsString = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.amiTags.string")
        amiDistributionConfigurationDescription = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.description")
        amiDistributionConfigurationKmsKeyId = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.kmsKeyId")
        amiDistributionConfigurationName = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.name")
        containerDistributionConfigurationDescription = jResp.string(of: "image.distributionConfiguration.distributions[i].containerDistributionConfiguration.description")
        TargetRepositoryRepositoryName = jResp.string(of: "image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.repositoryName")
        TargetRepositoryService = jResp.string(of: "image.distributionConfiguration.distributions[i].containerDistributionConfiguration.targetRepository.service")
        region = jResp.string(of: "image.distributionConfiguration.distributions[i].region")
        DiskImageFormat = jResp.string(of: "image.distributionConfiguration.distributions[i].s3ExportConfiguration.diskImageFormat")
        RoleName = jResp.string(of: "image.distributionConfiguration.distributions[i].s3ExportConfiguration.roleName")
        S3Bucket = jResp.string(of: "image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Bucket")
        S3Prefix = jResp.string(of: "image.distributionConfiguration.distributions[i].s3ExportConfiguration.s3Prefix")
        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationalUnitArns[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations").intValue
        while j < count_j {
            jResp.j = j
            accountId = jResp.string(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].accountId")
            enabled = jResp.int(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].enabled").intValue
            LaunchTemplateId = jResp.string(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateId")
            LaunchTemplateName = jResp.string(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateName")
            LaunchTemplateVersion = jResp.string(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateVersion")
            maxParallelLaunches = jResp.int(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].maxParallelLaunches").intValue
            TargetResourceCount = jResp.int(of: "image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].snapshotConfiguration.targetResourceCount").intValue
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].launchTemplateConfigurations").intValue
        while j < count_j {
            jResp.j = j
            accountId = jResp.string(of: "image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].accountId")
            launchTemplateId = jResp.string(of: "image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].launchTemplateId")
            setDefaultVersion = jResp.int(of: "image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].setDefaultVersion").intValue
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "image.distributionConfiguration.distributions[i].licenseConfigurationArns").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.distributionConfiguration.distributions[i].licenseConfigurationArns[j]")
            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.imageRecipe.blockDeviceMappings").intValue
    while i < count_i {
        jResp.i = i
        deviceName = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].deviceName")
        ebsDeleteOnTermination = jResp.int(of: "image.imageRecipe.blockDeviceMappings[i].ebs.deleteOnTermination").intValue
        ebsEncrypted = jResp.int(of: "image.imageRecipe.blockDeviceMappings[i].ebs.encrypted").intValue
        ebsIops = jResp.int(of: "image.imageRecipe.blockDeviceMappings[i].ebs.iops").intValue
        ebsKmsKeyId = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].ebs.kmsKeyId")
        ebsSnapshotId = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].ebs.snapshotId")
        ebsThroughput = jResp.int(of: "image.imageRecipe.blockDeviceMappings[i].ebs.throughput").intValue
        ebsVolumeSize = jResp.int(of: "image.imageRecipe.blockDeviceMappings[i].ebs.volumeSize").intValue
        ebsVolumeType = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].ebs.volumeType")
        noDevice = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].noDevice")
        virtualName = jResp.string(of: "image.imageRecipe.blockDeviceMappings[i].virtualName")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.imageRecipe.components").intValue
    while i < count_i {
        jResp.i = i
        componentArn = jResp.string(of: "image.imageRecipe.components[i].componentArn")
        j = 0
        count_j = jResp.size(ofArray: "image.imageRecipe.components[i].parameters").intValue
        while j < count_j {
            jResp.j = j
            name = jResp.string(of: "image.imageRecipe.components[i].parameters[j].name")
            k = 0
            count_k = jResp.size(ofArray: "image.imageRecipe.components[i].parameters[j].value").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "image.imageRecipe.components[i].parameters[j].value[k]")
                k = k + 1
            }

            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.infrastructureConfiguration.instanceTypes").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "image.infrastructureConfiguration.instanceTypes[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.infrastructureConfiguration.securityGroupIds").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "image.infrastructureConfiguration.securityGroupIds[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.outputResources.amis").intValue
    while i < count_i {
        jResp.i = i
        accountId = jResp.string(of: "image.outputResources.amis[i].accountId")
        description = jResp.string(of: "image.outputResources.amis[i].description")
        image = jResp.string(of: "image.outputResources.amis[i].image")
        name = jResp.string(of: "image.outputResources.amis[i].name")
        region = jResp.string(of: "image.outputResources.amis[i].region")
        stateReason = jResp.string(of: "image.outputResources.amis[i].state.reason")
        stateStatus = jResp.string(of: "image.outputResources.amis[i].state.status")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "image.outputResources.containers").intValue
    while i < count_i {
        jResp.i = i
        region = jResp.string(of: "image.outputResources.containers[i].region")
        j = 0
        count_j = jResp.size(ofArray: "image.outputResources.containers[i].imageUris").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "image.outputResources.containers[i].imageUris[j]")
            j = j + 1
        }

        i = i + 1
    }

    // A sample JSON response body parsed by the above code:

    // {
    //   "image": {
    //     "arn": "string",
    //     "buildType": "string",
    //     "containerRecipe": {
    //       "arn": "string",
    //       "components": [
    //         {
    //           "componentArn": "string",
    //           "parameters": [
    //             {
    //               "name": "string",
    //               "value": [
    //                 "string"
    //               ]
    //             }
    //           ]
    //         }
    //       ],
    //       "containerType": "string",
    //       "dateCreated": "string",
    //       "description": "string",
    //       "dockerfileTemplateData": "string",
    //       "encrypted": boolean,
    //       "instanceConfiguration": {
    //         "blockDeviceMappings": [
    //           {
    //             "deviceName": "string",
    //             "ebs": {
    //               "deleteOnTermination": boolean,
    //               "encrypted": boolean,
    //               "iops": number,
    //               "kmsKeyId": "string",
    //               "snapshotId": "string",
    //               "throughput": number,
    //               "volumeSize": number,
    //               "volumeType": "string"
    //             },
    //             "noDevice": "string",
    //             "virtualName": "string"
    //           }
    //         ],
    //         "image": "string"
    //       },
    //       "kmsKeyId": "string",
    //       "name": "string",
    //       "owner": "string",
    //       "parentImage": "string",
    //       "platform": "string",
    //       "tags": {
    //         "string": "string"
    //       },
    //       "targetRepository": {
    //         "repositoryName": "string",
    //         "service": "string"
    //       },
    //       "version": "string",
    //       "workingDirectory": "string"
    //     },
    //     "dateCreated": "string",
    //     "distributionConfiguration": {
    //       "arn": "string",
    //       "dateCreated": "string",
    //       "dateUpdated": "string",
    //       "description": "string",
    //       "distributions": [
    //         {
    //           "amiDistributionConfiguration": {
    //             "amiTags": {
    //               "string": "string"
    //             },
    //             "description": "string",
    //             "kmsKeyId": "string",
    //             "launchPermission": {
    //               "organizationalUnitArns": [
    //                 "string"
    //               ],
    //               "organizationArns": [
    //                 "string"
    //               ],
    //               "userGroups": [
    //                 "string"
    //               ],
    //               "userIds": [
    //                 "string"
    //               ]
    //             },
    //             "name": "string",
    //             "targetAccountIds": [
    //               "string"
    //             ]
    //           },
    //           "containerDistributionConfiguration": {
    //             "containerTags": [
    //               "string"
    //             ],
    //             "description": "string",
    //             "targetRepository": {
    //               "repositoryName": "string",
    //               "service": "string"
    //             }
    //           },
    //           "fastLaunchConfigurations": [
    //             {
    //               "accountId": "string",
    //               "enabled": boolean,
    //               "launchTemplate": {
    //                 "launchTemplateId": "string",
    //                 "launchTemplateName": "string",
    //                 "launchTemplateVersion": "string"
    //               },
    //               "maxParallelLaunches": number,
    //               "snapshotConfiguration": {
    //                 "targetResourceCount": number
    //               }
    //             }
    //           ],
    //           "launchTemplateConfigurations": [
    //             {
    //               "accountId": "string",
    //               "launchTemplateId": "string",
    //               "setDefaultVersion": boolean
    //             }
    //           ],
    //           "licenseConfigurationArns": [
    //             "string"
    //           ],
    //           "region": "string",
    //           "s3ExportConfiguration": {
    //             "diskImageFormat": "string",
    //             "roleName": "string",
    //             "s3Bucket": "string",
    //             "s3Prefix": "string"
    //           }
    //         }
    //       ],
    //       "name": "string",
    //       "tags": {
    //         "string": "string"
    //       },
    //       "timeoutMinutes": number
    //     },
    //     "enhancedImageMetadataEnabled": boolean,
    //     "imageRecipe": {
    //       "additionalInstanceConfiguration": {
    //         "systemsManagerAgent": {
    //           "uninstallAfterBuild": boolean
    //         },
    //         "userDataOverride": "string"
    //       },
    //       "arn": "string",
    //       "blockDeviceMappings": [
    //         {
    //           "deviceName": "string",
    //           "ebs": {
    //             "deleteOnTermination": boolean,
    //             "encrypted": boolean,
    //             "iops": number,
    //             "kmsKeyId": "string",
    //             "snapshotId": "string",
    //             "throughput": number,
    //             "volumeSize": number,
    //             "volumeType": "string"
    //           },
    //           "noDevice": "string",
    //           "virtualName": "string"
    //         }
    //       ],
    //       "components": [
    //         {
    //           "componentArn": "string",
    //           "parameters": [
    //             {
    //               "name": "string",
    //               "value": [
    //                 "string"
    //               ]
    //             }
    //           ]
    //         }
    //       ],
    //       "dateCreated": "string",
    //       "description": "string",
    //       "name": "string",
    //       "owner": "string",
    //       "parentImage": "string",
    //       "platform": "string",
    //       "tags": {
    //         "string": "string"
    //       },
    //       "type": "string",
    //       "version": "string",
    //       "workingDirectory": "string"
    //     },
    //     "imageTestsConfiguration": {
    //       "imageTestsEnabled": boolean,
    //       "timeoutMinutes": number
    //     },
    //     "infrastructureConfiguration": {
    //       "arn": "string",
    //       "dateCreated": "string",
    //       "dateUpdated": "string",
    //       "description": "string",
    //       "instanceMetadataOptions": {
    //         "httpPutResponseHopLimit": number,
    //         "httpTokens": "string"
    //       },
    //       "instanceProfileName": "string",
    //       "instanceTypes": [
    //         "string"
    //       ],
    //       "keyPair": "string",
    //       "logging": {
    //         "s3Logs": {
    //           "s3BucketName": "string",
    //           "s3KeyPrefix": "string"
    //         }
    //       },
    //       "name": "string",
    //       "resourceTags": {
    //         "string": "string"
    //       },
    //       "securityGroupIds": [
    //         "string"
    //       ],
    //       "snsTopicArn": "string",
    //       "subnetId": "string",
    //       "tags": {
    //         "string": "string"
    //       },
    //       "terminateInstanceOnFailure": boolean
    //     },
    //     "name": "string",
    //     "osVersion": "string",
    //     "outputResources": {
    //       "amis": [
    //         {
    //           "accountId": "string",
    //           "description": "string",
    //           "image": "string",
    //           "name": "string",
    //           "region": "string",
    //           "state": {
    //             "reason": "string",
    //             "status": "string"
    //           }
    //         }
    //       ],
    //       "containers": [
    //         {
    //           "imageUris": [
    //             "string"
    //           ],
    //           "region": "string"
    //         }
    //       ]
    //     },
    //     "platform": "string",
    //     "sourcePipelineArn": "string",
    //     "sourcePipelineName": "string",
    //     "state": {
    //       "reason": "string",
    //       "status": "string"
    //     },
    //     "tags": {
    //       "string": "string"
    //     },
    //     "type": "string",
    //     "version": "string"
    //   },
    //   "requestId": "string"
    // }

}