Chilkat Online Tools

GetImage C++ Example

EC2 Image Builder

#include <CkRest.h>
#include <CkAuthAws.h>
#include <CkStringBuilder.h>
#include <CkJsonObject.h>

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

    CkRest rest;
    bool success;

    CkAuthAws authAws;
    authAws.put_AccessKey("AWS_ACCESS_KEY");
    authAws.put_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.put_Region("us-west-2");
    authAws.put_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",443,true,true);
    if (success != true) {
        std::cout << "ConnectFailReason: " << rest.get_ConnectFailReason() << "\r\n";
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    rest.AddHeader("Content-Type","application/x-amz-json-1.1");
    rest.AddHeader("X-Amz-Target","GetImage");

    CkStringBuilder sbResponseBody;
    success = rest.FullRequestNoBodySb("GET","/GetImage",sbResponseBody);
    if (success != true) {
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    int respStatusCode = rest.get_ResponseStatusCode();
    std::cout << "response status code = " << respStatusCode << "\r\n";
    if (respStatusCode != 200) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << rest.responseHeader() << "\r\n";
        std::cout << "Response Body:" << "\r\n";
        std::cout << sbResponseBody.getAsString() << "\r\n";
        return;
    }

    CkJsonObject jResp;
    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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

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

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

            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.containerRecipe.instanceConfiguration.blockDeviceMappings");
    while (i < count_i) {
        jResp.put_I(i);
        deviceName = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].deviceName");
        DeleteOnTermination = jResp.IntOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.deleteOnTermination");
        ebsEncrypted = jResp.IntOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.encrypted");
        Iops = jResp.IntOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.iops");
        ebsKmsKeyId = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.kmsKeyId");
        SnapshotId = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.snapshotId");
        Throughput = jResp.IntOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.throughput");
        VolumeSize = jResp.IntOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeSize");
        VolumeType = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].ebs.volumeType");
        noDevice = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].noDevice");
        virtualName = jResp.stringOf("image.containerRecipe.instanceConfiguration.blockDeviceMappings[i].virtualName");
        i = i + 1;
    }

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

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.organizationArns[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userGroups[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.launchPermission.userIds[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].amiDistributionConfiguration.targetAccountIds[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].containerDistributionConfiguration.containerTags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].fastLaunchConfigurations");
        while (j < count_j) {
            jResp.put_J(j);
            accountId = jResp.stringOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].accountId");
            enabled = jResp.IntOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].enabled");
            LaunchTemplateId = jResp.stringOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateId");
            LaunchTemplateName = jResp.stringOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateName");
            LaunchTemplateVersion = jResp.stringOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].launchTemplate.launchTemplateVersion");
            maxParallelLaunches = jResp.IntOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].maxParallelLaunches");
            TargetResourceCount = jResp.IntOf("image.distributionConfiguration.distributions[i].fastLaunchConfigurations[j].snapshotConfiguration.targetResourceCount");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].launchTemplateConfigurations");
        while (j < count_j) {
            jResp.put_J(j);
            accountId = jResp.stringOf("image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].accountId");
            launchTemplateId = jResp.stringOf("image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].launchTemplateId");
            setDefaultVersion = jResp.IntOf("image.distributionConfiguration.distributions[i].launchTemplateConfigurations[j].setDefaultVersion");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("image.distributionConfiguration.distributions[i].licenseConfigurationArns");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("image.distributionConfiguration.distributions[i].licenseConfigurationArns[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.imageRecipe.blockDeviceMappings");
    while (i < count_i) {
        jResp.put_I(i);
        deviceName = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].deviceName");
        ebsDeleteOnTermination = jResp.IntOf("image.imageRecipe.blockDeviceMappings[i].ebs.deleteOnTermination");
        ebsEncrypted = jResp.IntOf("image.imageRecipe.blockDeviceMappings[i].ebs.encrypted");
        ebsIops = jResp.IntOf("image.imageRecipe.blockDeviceMappings[i].ebs.iops");
        ebsKmsKeyId = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].ebs.kmsKeyId");
        ebsSnapshotId = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].ebs.snapshotId");
        ebsThroughput = jResp.IntOf("image.imageRecipe.blockDeviceMappings[i].ebs.throughput");
        ebsVolumeSize = jResp.IntOf("image.imageRecipe.blockDeviceMappings[i].ebs.volumeSize");
        ebsVolumeType = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].ebs.volumeType");
        noDevice = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].noDevice");
        virtualName = jResp.stringOf("image.imageRecipe.blockDeviceMappings[i].virtualName");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.imageRecipe.components");
    while (i < count_i) {
        jResp.put_I(i);
        componentArn = jResp.stringOf("image.imageRecipe.components[i].componentArn");
        j = 0;
        count_j = jResp.SizeOfArray("image.imageRecipe.components[i].parameters");
        while (j < count_j) {
            jResp.put_J(j);
            name = jResp.stringOf("image.imageRecipe.components[i].parameters[j].name");
            k = 0;
            count_k = jResp.SizeOfArray("image.imageRecipe.components[i].parameters[j].value");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("image.imageRecipe.components[i].parameters[j].value[k]");
                k = k + 1;
            }

            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.infrastructureConfiguration.instanceTypes");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("image.infrastructureConfiguration.instanceTypes[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.infrastructureConfiguration.securityGroupIds");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("image.infrastructureConfiguration.securityGroupIds[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.outputResources.amis");
    while (i < count_i) {
        jResp.put_I(i);
        accountId = jResp.stringOf("image.outputResources.amis[i].accountId");
        description = jResp.stringOf("image.outputResources.amis[i].description");
        image = jResp.stringOf("image.outputResources.amis[i].image");
        name = jResp.stringOf("image.outputResources.amis[i].name");
        region = jResp.stringOf("image.outputResources.amis[i].region");
        stateReason = jResp.stringOf("image.outputResources.amis[i].state.reason");
        stateStatus = jResp.stringOf("image.outputResources.amis[i].state.status");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("image.outputResources.containers");
    while (i < count_i) {
        jResp.put_I(i);
        region = jResp.stringOf("image.outputResources.containers[i].region");
        j = 0;
        count_j = jResp.SizeOfArray("image.outputResources.containers[i].imageUris");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("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"
    // }
    }