AWS::ImageBuilder::Image - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::ImageBuilder::Image

Creates a new image. This request will create a new image along with all of the configured output resources defined in the distribution configuration. You must specify exactly one recipe for your image, using either a ContainerRecipeArn or an ImageRecipeArn.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::ImageBuilder::Image", "Properties" : { "ContainerRecipeArn" : String, "DistributionConfigurationArn" : String, "EnhancedImageMetadataEnabled" : Boolean, "ExecutionRole" : String, "ImageRecipeArn" : String, "ImageScanningConfiguration" : ImageScanningConfiguration, "ImageTestsConfiguration" : ImageTestsConfiguration, "InfrastructureConfigurationArn" : String, "Tags" : {Key: Value, ...}, "Workflows" : [ WorkflowConfiguration, ... ] } }

Properties

ContainerRecipeArn

The Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested.

Required: No

Type: String

Update requires: Replacement

DistributionConfigurationArn

The Amazon Resource Name (ARN) of the distribution configuration that defines and configures the outputs of your pipeline.

Required: No

Type: String

Update requires: Replacement

EnhancedImageMetadataEnabled

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.

Required: No

Type: Boolean

Update requires: Replacement

ExecutionRole

The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions.

Required: No

Type: String

Pattern: ^(?:arn:aws(?:-[a-z]+)*:iam::[0-9]{12}:role/)?[a-zA-Z_0-9+=,.@\-_/]+$

Minimum: 1

Maximum: 2048

Update requires: No interruption

ImageRecipeArn

The Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed.

Required: No

Type: String

Update requires: Replacement

ImageScanningConfiguration

Contains settings for vulnerability scans.

Required: No

Type: ImageScanningConfiguration

Update requires: Replacement

ImageTestsConfiguration

The image tests configuration of the image.

Required: No

Type: ImageTestsConfiguration

Update requires: Replacement

InfrastructureConfigurationArn

The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.

Required: No

Type: String

Update requires: Replacement

Tags

The tags of the image.

Required: No

Type: Object of String

Pattern: .{1,}

Update requires: Replacement

Workflows

Contains an array of workflow configuration objects.

Required: No

Type: Array of WorkflowConfiguration

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource ARN, such as arn:aws:imagebuilder:us-west-2:123456789012:image/my-example-image.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

Returns the Amazon Resource Name (ARN) of the image. For example, arn:aws:imagebuilder:us-west-2:123456789012:image/mybasicrecipe/2019.12.03/1.

ImageId

Returns the AMI ID of the Amazon EC2 AMI in the Region in which you are using Image Builder. Values are returned only for AMIs, and not for container images.

ImageUri

Returns the URI for a container image created in the context Region. Values are returned only for container images, and not for AMIs.

Name

Returns the name of the image.

Examples

Create an image

The following example shows the schema for all of the parameters of the Image resource document in both YAML and JSON format.

YAML

Resources: ImageAllParameters: Type: 'AWS::ImageBuilder::Image' Properties: ImageRecipeArn: !Ref ImageRecipeArn InfrastructureConfigurationArn: !Ref InfrastructureConfigurationArn DistributionConfigurationArn: !Ref DistributionConfigurationArn ImageTestsConfiguration: ImageTestsEnabled: false TimeoutMinutes: 60 Tags: CustomerImageTagKey1: 'CustomerImageTagValue1' CustomerImageTagKey2: 'CustomerImageTagValue2'

JSON

{ "Resources": { "ImageAllParameters": { "Type": "AWS::ImageBuilder::Image", "Properties": { "ImageRecipeArn": { "Ref": "ImageRecipeArn" }, "InfrastructureConfigurationArn": { "Ref": "InfrastructureConfigurationArn" }, "DistributionConfigurationArn": { "Ref": "DistributionConfigurationArn" }, "ImageTestsConfiguration": { "ImageTestsEnabled": false, "TimeoutMinutes": 60 }, "Tags": { "CustomerImageTagKey1": "CustomerImageTagValue1", "CustomerImageTagKey2": "CustomerImageTagValue2" } } } } }