AWS::ImageBuilder::DistributionConfiguration - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::ImageBuilder::DistributionConfiguration

通过使用分配配置,您可以指定输出 AMI 的名称和描述,授权其他 AWS 账户启动 AMI,并将 AMI 复制到其他 AWS 区域。您还可以将 AMI 导出到 Amazon S3。

语法

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

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

属性

Description

此分配配置的描述。

必需:否

类型:字符串

最低1

最高1024

Update requires: No interruption

Distributions

此分配配置的格式化为分配对象数组的分配。

必需:是

类型分配的列表

Update requires: No interruption

Name

此分配配置的名称。

必需:是

类型:字符串

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

Update requires: Replacement

Tags

此分配配置的标签。

必需:否

类型:字符串的映射

Update requires: No interruption

返回值

Ref

在将此资源的逻辑 ID 传递给内部 Ref 函数时,Ref 返回 资源 ARN,如 arn:aws:imagebuilder:us-west-2:123456789012:distribution-configuration/myexampledistribution

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

Fn::GetAtt

Fn::GetAtt 内部函数返回此类型的一个指定属性的值。以下为可用属性和示例返回值。

有关使用 Fn::GetAtt 内部函数的更多信息,请参阅 Fn::GetAtt

Arn

返回此分配配置的 Amazon 资源名称 (ARN)。应用以下模式:^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+)?)?$

示例

创建分配配置

以下示例同时以 YAML 和 JSON 格式显示 DistributionConfiguration 资源文档的所有参数的架构。

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'br

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" } } } } }

另请参阅