AWS::ImageBuilder::DistributionConfiguration Distribution - 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::DistributionConfiguration Distribution

The distribution configuration distribution defines the settings for a specific Region in the Distribution Configuration. You must specify whether the distribution is for an AMI or a container image. To do so, include exactly one of the following data types for your distribution:

  • amiDistributionConfiguration

  • containerDistributionConfiguration

Syntax

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

Properties

AmiDistributionConfiguration

The specific AMI settings, such as launch permissions and AMI tags. For details, see example schema below.

Required: No

Type: AmiDistributionConfiguration

Update requires: No interruption

ContainerDistributionConfiguration

Container distribution settings for encryption, licensing, and sharing in a specific Region. For details, see example schema below.

Required: No

Type: ContainerDistributionConfiguration

Update requires: No interruption

FastLaunchConfigurations

The Windows faster-launching configurations to use for AMI distribution.

Required: No

Type: Array of FastLaunchConfiguration

Minimum: 1

Maximum: 1000

Update requires: No interruption

LaunchTemplateConfigurations

A group of launchTemplateConfiguration settings that apply to image distribution for specified accounts.

Required: No

Type: Array of LaunchTemplateConfiguration

Minimum: 1

Maximum: 100

Update requires: No interruption

LicenseConfigurationArns

The License Manager Configuration to associate with the AMI in the specified Region. For more information, see the LicenseConfiguration API.

Required: No

Type: Array of String

Minimum: 1

Maximum: 50

Update requires: No interruption

Region

The target Region for the Distribution Configuration. For example, eu-west-1.

Required: Yes

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

Examples

Example 1: AmiDistributionConfiguration schema with launch permissions

The following example shows the schema for the AmiDistributionConfiguration property in both YAML and JSON format.

Note

To make an AMI public, set the launch permission authorized accounts to all. See the examples for making an AMI public at EC2 ModifyImageAttribute.

YAML

Distributions: - Region: 'us-west-2' AmiDistributionConfiguration: Name: 'AmiCopyConfiguration - {{ imagebuilder:buildDate }}' Description: 'Share an AMI in the distribution Region by granting launch permissions to specified Amazon organizations, OUs, user groups, and accounts.' AmiTags: AmiTagKey: 'AmiTagValue' LaunchPermissionConfiguration: OrganizationArns: - 'arn:aws:organizations::123456789012:organization/o-myorganization123' OrganizationalUnitArns: - 'arn:aws:organizations::123456789012:ou/o-123example/ou-1234-myorganizationalunit' UserGroups: - 'GroupName1' - 'GroupName2' UserIds: - '123456789012' - '345678901234'

JSON

"{ "Distributions": [{ AmiDistributionConfiguration": { "Name": "AmiCopyConfiguration - {{ imagebuilder:buildDate }}", "Description": "Share an AMI in the distribution Region by granting launch permissions to specified user groups and accounts.", "AmiTags": { "AmiTagKey": "AmiTagValue" }, "LaunchPermissionConfiguration": { "OrganizationArns": ["arn:aws:organizations::123456789012:organizatio ARNn/o-myorganization123"], "OrganizationalUnitArns": ["arn:aws:organizations::123456789012:ou/o-123example/ou-1234-myorganizationalunit"], "UserGroups": [ "GroupName1", "GroupName2" ], "UserIds": [ "123456789012", "345678901234" ] } }] }

Example 2: Create a distribution configuration resource for a copied AMI

The following example shows the schema for the AmiDistributionConfiguration property in both YAML and JSON.

YAML

Distributions: - Region: 'us-west-2' AmiDistributionConfiguration: Name: AmiCopyConfiguration - {{ imagebuilder:buildDate }} Description: 'Distribute a copy of the AMI to specific accounts in the destination Region.' AmiTags: AmiTagKey: 'AmiTagValue' TargetAccountIds: - '123456789012' - '345678901234'

JSON

{ "Distributions": [{ "AmiDistributionConfiguration": { "Name": "AmiCopyConfiguration - {{ imagebuilder:buildDate }}", "Description": "Distribute a copy of the AMI to specific accounts in the destination Region.", "AmiTags": { "AmiTagKey": "AmiTagValue" }, "TargetAccountIds": ["123456789012", "345678901234"] } }] }

Example 3: ContainerDistributionConfiguration schema

The following example shows the schema for the ContainerDistributionConfiguration property in both YAML and JSON format.

YAML

Distributions: - Region: 'us-west-2' ContainerDistributionConfiguration: Description: 'test distribution cfn template' TargetRepository: Service: ECR RepositoryName: 'cfn-test' ContainerTags: - 'Tag1' - 'Tag2'

JSON

{ "Distributions": [{ "ContainerDistributionConfiguration": { "Description": "test distribution cfn template", "TargetRepository": { "Service": "ECR", "RepositoryName": "cfn-test" }, "ContainerTags": ["Tag1", "Tag2"] } }] }