Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . imagebuilder ]

get-image

Description

Gets an image.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  get-image
--image-build-version-arn <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--image-build-version-arn (string)

The Amazon Resource Name (ARN) of the image that you want to retrieve.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To get image details

The following get-image example lists the details of an image by specifying its ARN.

aws imagebuilder get-image \
    --image-build-version-arn arn:aws:imagebuilder:us-west-2:123456789012:image/mybasicrecipe/2019.12.03/1

Output:

{
    "requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
    "image": {
        "arn": "arn:aws:imagebuilder:us-west-2:123456789012:image/mybasicrecipe/2019.12.03/1",
        "name": "MyBasicRecipe",
        "version": "2019.12.03/1",
        "platform": "Windows",
        "state": {
            "status": "BUILDING"
        },
        "imageRecipe": {
            "arn": "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/mybasicrecipe/2019.12.03",
            "name": "MyBasicRecipe",
            "description": "This example image recipe creates a Windows 2016 image.",
            "platform": "Windows",
            "version": "2019.12.03",
            "components": [
                {
                    "componentArn": "arn:aws:imagebuilder:us-west-2:123456789012:component/myexamplecomponent/2019.12.02/1"
                },
                {
                    "componentArn": "arn:aws:imagebuilder:us-west-2:123456789012:component/myimportedcomponent/1.0.0/1"
                }
            ],
            "parentImage": "arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/2019.12.17/1",
            "dateCreated": "2020-02-14T19:46:16.904Z",
            "tags": {}
        },
        "infrastructureConfiguration": {
            "arn": "arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/myexampleinfrastructure",
            "name": "MyExampleInfrastructure",
            "description": "An example that will retain instances of failed builds",
            "instanceTypes": [
                "m5.large",
                "m5.xlarge"
            ],
            "instanceProfileName": "EC2InstanceProfileForImageFactory",
            "securityGroupIds": [
                "sg-a1b2c3d4"
            ],
            "subnetId": "subnet-a1b2c3d4",
            "logging": {
                "s3Logs": {
                    "s3BucketName": "bucket-name",
                    "s3KeyPrefix": "bucket-path"
                }
            },
            "keyPair": "Sam",
            "terminateInstanceOnFailure": false,
            "snsTopicArn": "arn:aws:sns:us-west-2:123456789012:sns-name",
            "dateCreated": "2020-02-14T21:21:05.098Z",
            "tags": {}
        },
        "imageTestsConfiguration": {
            "imageTestsEnabled": true,
            "timeoutMinutes": 720
        },
        "dateCreated": "2020-02-14T23:14:13.597Z",
        "outputResources": {
            "amis": []
        },
        "tags": {}
    }
}

For more information, see Setting Up and Managing an EC2 Image Builder Image Pipeline Using the AWS CLI in the EC2 Image Builder Users Guide.

Output

requestId -> (string)

The request ID that uniquely identifies this request.

image -> (structure)

The image object.

arn -> (string)

The Amazon Resource Name (ARN) of the image.

name -> (string)

The name of the image.

version -> (string)

The semantic version of the image.

platform -> (string)

The platform of the image.

enhancedImageMetadataEnabled -> (boolean)

Collects additional information about the image being created, including the operating system (OS) version and package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by default.

osVersion -> (string)

The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.

state -> (structure)

The state of the image.

status -> (string)

The status of the image.

reason -> (string)

The reason for the image's status.

imageRecipe -> (structure)

The image recipe used when creating the image.

arn -> (string)

The Amazon Resource Name (ARN) of the image recipe.

name -> (string)

The name of the image recipe.

description -> (string)

The description of the image recipe.

platform -> (string)

The platform of the image recipe.

owner -> (string)

The owner of the image recipe.

version -> (string)

The version of the image recipe.

components -> (list)

The components of the image recipe.

(structure)

Configuration details of the component.

componentArn -> (string)

The Amazon Resource Name (ARN) of the component.

parentImage -> (string)

The parent image of the image recipe.

blockDeviceMappings -> (list)

The block device mappings to apply when creating images from this recipe.

(structure)

Defines block device mappings for the instance used to configure your image.

deviceName -> (string)

The device to which these mappings apply.

ebs -> (structure)

Use to manage Amazon EBS-specific configuration for this mapping.

encrypted -> (boolean)

Use to configure device encryption.

deleteOnTermination -> (boolean)

Use to configure delete on termination of the associated device.

iops -> (integer)

Use to configure device IOPS.

kmsKeyId -> (string)

Use to configure the KMS key to use when encrypting the device.

snapshotId -> (string)

The snapshot that defines the device contents.

volumeSize -> (integer)

Use to override the device's volume size.

volumeType -> (string)

Use to override the device's volume type.

virtualName -> (string)

Use to manage instance ephemeral devices.

noDevice -> (string)

Use to remove a mapping from the parent image.

dateCreated -> (string)

The date on which this image recipe was created.

tags -> (map)

The tags of the image recipe.

key -> (string)

value -> (string)

workingDirectory -> (string)

The working directory to be used during build and test workflows.

sourcePipelineName -> (string)

The name of the image pipeline that created this image.

sourcePipelineArn -> (string)

The Amazon Resource Name (ARN) of the image pipeline that created this image.

infrastructureConfiguration -> (structure)

The infrastructure used when creating this image.

arn -> (string)

The Amazon Resource Name (ARN) of the infrastructure configuration.

name -> (string)

The name of the infrastructure configuration.

description -> (string)

The description of the infrastructure configuration.

instanceTypes -> (list)

The instance types of the infrastructure configuration.

(string)

instanceProfileName -> (string)

The instance profile of the infrastructure configuration.

securityGroupIds -> (list)

The security group IDs of the infrastructure configuration.

(string)

subnetId -> (string)

The subnet ID of the infrastructure configuration.

logging -> (structure)

The logging configuration of the infrastructure configuration.

s3Logs -> (structure)

The Amazon S3 logging configuration.

s3BucketName -> (string)

The Amazon S3 bucket in which to store the logs.

s3KeyPrefix -> (string)

The Amazon S3 path in which to store the logs.

keyPair -> (string)

The EC2 key pair of the infrastructure configuration.

terminateInstanceOnFailure -> (boolean)

The terminate instance on failure configuration of the infrastructure configuration.

snsTopicArn -> (string)

The SNS topic Amazon Resource Name (ARN) of the infrastructure configuration.

dateCreated -> (string)

The date on which the infrastructure configuration was created.

dateUpdated -> (string)

The date on which the infrastructure configuration was last updated.

resourceTags -> (map)

The tags attached to the resource created by Image Builder.

key -> (string)

value -> (string)

tags -> (map)

The tags of the infrastructure configuration.

key -> (string)

value -> (string)

distributionConfiguration -> (structure)

The distribution configuration used when creating this image.

arn -> (string)

The Amazon Resource Name (ARN) of the distribution configuration.

name -> (string)

The name of the distribution configuration.

description -> (string)

The description of the distribution configuration.

distributions -> (list)

The distributions of the distribution configuration.

(structure)

Defines the settings for a specific Region.

region -> (string)

The target Region.

amiDistributionConfiguration -> (structure)

The specific AMI settings (for example, launch permissions, AMI tags).

name -> (string)

The name of the distribution configuration.

description -> (string)

The description of the distribution configuration.

amiTags -> (map)

The tags to apply to AMIs distributed to this Region.

key -> (string)

value -> (string)

kmsKeyId -> (string)

The KMS key identifier used to encrypt the distributed image.

launchPermission -> (structure)

Launch permissions can be used to configure which AWS accounts can use the AMI to launch instances.

userIds -> (list)

The AWS account ID.

(string)

userGroups -> (list)

The name of the group.

(string)

licenseConfigurationArns -> (list)

The License Manager Configuration to associate with the AMI in the specified Region.

(string)

timeoutMinutes -> (integer)

The maximum duration in minutes for this distribution configuration.

dateCreated -> (string)

The date on which this distribution configuration was created.

dateUpdated -> (string)

The date on which this distribution configuration was last updated.

tags -> (map)

The tags of the distribution configuration.

key -> (string)

value -> (string)

imageTestsConfiguration -> (structure)

The image tests configuration used when creating this image.

imageTestsEnabled -> (boolean)

Defines if tests should be executed when building this image.

timeoutMinutes -> (integer)

The maximum time in minutes that tests are permitted to run.

dateCreated -> (string)

The date on which this image was created.

outputResources -> (structure)

The output resources produced when creating this image.

amis -> (list)

The EC2 AMIs created by this image.

(structure)

Details of an EC2 AMI.

region -> (string)

The AWS Region of the EC2 AMI.

image -> (string)

The AMI ID of the EC2 AMI.

name -> (string)

The name of the EC2 AMI.

description -> (string)

The description of the EC2 AMI.

state -> (structure)

Image state shows the image status and the reason for that status.

status -> (string)

The status of the image.

reason -> (string)

The reason for the image's status.

tags -> (map)

The tags of the image.

key -> (string)

value -> (string)