AWS::ImageBuilder::DistributionConfiguration - AWS CloudFormation

AWS::ImageBuilder::DistributionConfiguration

A distribution configuration allows you to specify the name and description of your output AMI, authorize other AWS accounts to launch the AMI, and replicate the AMI to other AWS Regions. It also allows you to export the AMI to Amazon S3.

Syntax

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

JSON

{ "Type" : "AWS::ImageBuilder::DistributionConfiguration", "Properties" : { "Description" : String, "Distributions" : [ Distribution, ... ], "Name" : String, "Tags" : {Key : Value, ...} } }

YAML

Type: AWS::ImageBuilder::DistributionConfiguration Properties: Description: String Distributions: - Distribution Name: String Tags: Key : Value

Properties

Description

The description of this distribution configuration.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

Distributions

The distributions of this distribution configuration formatted as an array of Distribution objects.

Required: Yes

Type: List of Distribution

Update requires: No interruption

Name

The name of this distribution configuration.

Required: Yes

Type: String

Pattern: ^[-_A-Za-z-0-9][-_A-Za-z0-9 ]{1,126}[-_A-Za-z-0-9]$

Update requires: Replacement

Tags

The tags of this distribution configuration.

Required: No

Type: Map of String

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (ARN) of the resource, such as arn:aws:imagebuilder:us-west-2:123456789012:distribution-configuration/myexampledistribution.

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 this distribution configuration. The following pattern is applied: ^arn:aws[^:]*:imagebuilder:[^:]+:(?:\d{12}|aws):(?:image-recipe|infrastructure-configuration|distribution-configuration|component|image|image-pipeline)/[a-z0-9-_]+(?:/(?:(?:x|\d+)\.(?:x|\d+)\.(?:x|\d+))(?:/\d+)?)?$.

Name

Not currently supported by AWS CloudFormation.

Examples

Create a distribution configuration

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

YAML

Resources: DistributionConfigurationAllParameters: Type: 'AWS::ImageBuilder::DistributionConfiguration' Properties: Name: 'distribution-configuration-name' Description: 'description' Distributions: - Region: 'us-west-2' AmiDistributionConfiguration: Name: 'ami-distro-config-name-1 {{ imagebuilder:buildDate }}' Description: 'description' AmiTags: AmiTagKey: 'ami-tag-key' LaunchPermissionConfiguration: UserGroups: - 'DummyGroup1' - 'DummyGroup2' UserIds: - '123123123123' # Dummy account Id A - '321321321321' # Dummy account Id B LicenseConfigurationArns: - 'example-license-configuration-arn' - Region: 'us-east-1' AmiDistributionConfiguration: Name: 'ami-distro-config-name-2 {{ imagebuilder:buildDate }}' Description: 'description' Tags: CustomerDistributionConfigTagKey1: 'CustomerDistributionConfigTagValue1' CustomerDistributionConfigTagKey2: 'CustomerDistributionConfigTagValue2'

JSON

{ "Resources": { "DistributionConfigurationAllParameters": { "Type": "AWS::ImageBuilder::DistributionConfiguration", "Properties": { "Name": "distribution-configuration-name", "Description": "description", "Distributions": [ { "Region": "us-west-2", "AmiDistributionConfiguration": { "Name": "ami-distro-config-name-1 {{ imagebuilder:buildDate }}", "Description": "description", "AmiTags": { "AmiTagKey": "ami-tag-key" }, "LaunchPermissionConfiguration": { "UserGroups": [ "DummyGroup1", "DummyGroup2" ], "UserIds": [ "123123123123", "321321321321" ] } }, "LicenseConfigurationArns": [ "example-license-configuration-arn" ] }, { "Region": "us-east-1", "AmiDistributionConfiguration": { "Name": "ami-distro-config-name-2 {{ imagebuilder:buildDate }}", "Description": "description" } } ], "Tags": { "CustomerDistributionConfigTagKey1": "CustomerDistributionConfigTagValue1", "CustomerDistributionConfigTagKey2": "CustomerDistributionConfigTagValue2" } } } } }

See also