

这是新的《Amazon CloudFormation 模板参考指南》**。请更新您的书签和链接。有关开始使用 CloudFormation 的帮助，请参阅《Amazon CloudFormation 用户指南》[https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html)。

# Resource spec 和架构参考
Resource spec 和架构

以下主题包含压缩文件（zip 文件），其中包括每种资源类型的资源规范和架构。它们还包含一个组合的 JSON“resource spec”文件，其中包含 Amazon CloudFormation 支持的所有资源类型的资源规范。resource spec 是机器可读的规范，可用于构建工具来创建 CloudFormation 模板。

**Topics**
+ [

# CloudFormation 资源规范
](cfn-resource-specification.md)
+ [

# CloudFormation 资源提供程序架构
](resource-type-schemas.md)

# CloudFormation 资源规范
资源规范

Amazon CloudFormation 资源规范是一个 JSON 格式的文本文件，用于定义 CloudFormation 支持的资源和属性。该文档是机器可读的强类型规范，可用于构建工具来创建 CloudFormation 模板。例如，您可以使用此规范在 IDE（集成式开发环境）中为 CloudFormation 模板构建自动完成和验证功能。

此资源规范组织为单个文件和一系列文件，其中，每个文件均包含一种资源类型的定义。单个文件和分隔的文件包含相同的信息。根据工具和您的实施，使用适合您的文件。

要下载此资源规范，请参阅下表。

资源可用性可能因区域而异。要检查给定区域中某个资源的可用性，请参考该区域的资源规范。


|  区域名称  |  区域  |  单个文件  |  所有文件  | 
| --- | --- | --- | --- | 
|  美国东部（俄亥俄州）  |  `us-east-2`  |  [.json](https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://dnwj8swjjbsbt.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  美国东部（弗吉尼亚州北部）  |  `us-east-1`  |  [.json](https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d1uauaxba7bl26.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  美国西部（加利福尼亚北部）  |  `us-west-1`  |  [.json](https://d68hl49wbnanq.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d68hl49wbnanq.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  美国西部（俄勒冈州）  |  `us-west-2`  |  [.json](https://d201a2mn26r7lk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d201a2mn26r7lk.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  非洲（开普敦）  |  `af-south-1`  |  [.json](https://cfn-resource-specifications-af-south-1-prod.s3.af-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-af-south-1-prod.s3.af-south-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（香港）  |  `ap-east-1`  |  [.json](https://cfn-resource-specifications-ap-east-1-prod.s3.ap-east-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-east-1-prod.s3.ap-east-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（海得拉巴）  |  `ap-south-2`  |  [.json](https://cfn-resource-specifications-ap-south-2-prod.s3.ap-south-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-south-2-prod.s3.ap-south-2.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（雅加达）  |  `ap-southeast-3`  |  [.json](https://cfn-resource-specifications-ap-southeast-3-prod.s3.ap-southeast-3.amazonaws.com/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-southeast-3-prod.s3.ap-southeast-3.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（墨尔本）  |  `ap-southeast-4`  |  [.json](https://cfn-resource-specifications-ap-southeast-4-prod.s3.ap-southeast-4.amazonaws.com/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-southeast-4-prod.s3.ap-southeast-4.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（马来西亚）  |  `ap-southeast-5`  |  [.json](https://cfn-resource-specifications-ap-southeast-5-prod.s3.ap-southeast-5.amazonaws.com/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-southeast-5-prod.s3.ap-southeast-5.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（台北）  |  `ap-east-2`  |  [.json](https://cfn-resource-specifications-ap-east-2-975050364454-prod.s3.ap-east-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-east-2-975050364454-prod.s3.ap-east-2.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（泰国）  |  `ap-southeast-7`  |  [.json](https://cfn-resource-specifications-ap-southeast-7-767397843873-prod.s3.ap-southeast-7.amazonaws.com/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ap-southeast-7-767397843873-prod.s3.ap-southeast-7.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（孟买）  |  `ap-south-1`  |  [.json](https://d2senuesg1djtx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d2senuesg1djtx.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（大阪）  |  `ap-northeast-3`  |  [.json](https://d2zq80gdmjim8k.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d2zq80gdmjim8k.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（首尔）  |  `ap-northeast-2`  |  [.json](https://d1ane3fvebulky.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d1ane3fvebulky.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（新加坡）  |  `ap-southeast-1`  |  [.json](https://doigdx0kgq9el.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://doigdx0kgq9el.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（悉尼）  |  `ap-southeast-2`  |  [.json](https://d2stg8d246z9di.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d2stg8d246z9di.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  亚太地区（东京）  |  `ap-northeast-1`  |  [.json](https://d33vqc0rt9ld30.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d33vqc0rt9ld30.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  加拿大（中部）  |  `ca-central-1`  |  [.json](https://d2s8ygphhesbe7.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d2s8ygphhesbe7.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  加拿大西部（卡尔加里）  |  `ca-west-1`  |  [.json](https://cfn-resource-specifications-ca-west-1-prod.s3.ca-west-1.amazonaws.com/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-ca-west-1-prod.s3.ca-west-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  中国（北京）  |  `cn-north-1`  |  [.json](https://cfn-resource-specifications-cn-north-1-prod.s3.cn-north-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-cn-north-1-prod.s3.cn-north-1.amazonaws.com.cn/latest/CloudFormationResourceSpecification.zip)  | 
|  中国（宁夏）  |  `cn-northwest-1`  |  [.json](https://cfn-resource-specifications-cn-northwest-1-prod.s3.cn-northwest-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-cn-northwest-1-prod.s3.cn-northwest-1.amazonaws.com.cn/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（法兰克福）  |  `eu-central-1`  |  [.json](https://d1mta8qj7i28i2.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d1mta8qj7i28i2.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（爱尔兰）  |  `eu-west-1`  |  [.json](https://d3teyb21fexa9r.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d3teyb21fexa9r.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（伦敦）  |  `eu-west-2`  |  [.json](https://d1742qcu2c1ncx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d1742qcu2c1ncx.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（米兰）  |  `eu-south-1`  |  [.json](https://cfn-resource-specifications-eu-south-1-prod.s3.eu-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-eu-south-1-prod.s3.eu-south-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（巴黎）  |  `eu-west-3`  |  [.json](https://d2d0mfegowb3wk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d2d0mfegowb3wk.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（西班牙）  |  `eu-south-2`  |  [.json](https://cfn-resource-specifications-eu-south-2-prod.s3.eu-south-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-eu-south-2-prod.s3.eu-south-2.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲地区（斯德哥尔摩）  |  `eu-north-1`  |  [.json](https://diy8iv58sj6ba.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://diy8iv58sj6ba.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  欧洲（苏黎世）  |  `eu-central-2`  |  [.json](https://cfn-resource-specifications-eu-central-2-prod.s3.eu-central-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-eu-central-2-prod.s3.eu-central-2.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  以色列（特拉维夫）  |  `il-central-1`  |  [.json](https://cfn-resource-specifications-il-central-1-prod.s3.il-central-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-il-central-1-prod.s3.il-central-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  中东（巴林）  |  `me-south-1`  |  [.json](https://cfn-resource-specifications-me-south-1-prod.s3.me-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-me-south-1-prod.s3.me-south-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  中东（阿联酋）  |  `me-central-1`  |  [.json](https://cfn-resource-specifications-me-central-1-prod.s3.me-central-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-me-central-1-prod.s3.me-central-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  墨西哥（中部）  |  `mx-central-1`  |  [.json](https://cfn-resource-specifications-mx-central-1-590183656522-prod.s3.mx-central-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://cfn-resource-specifications-mx-central-1-590183656522-prod.s3.mx-central-1.amazonaws.com/latest/CloudFormationResourceSpecification.zip)  | 
|  南美洲（圣保罗）  |  `sa-east-1`  |  [.json](https://d3c9jyj3w509b0.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json)  |  [.zip](https://d3c9jyj3w509b0.cloudfront.net/latest/CloudFormationResourceSpecification.zip)  | 
|  Amazon GovCloud（美国东部）  |  `us-gov-east-1`  |  [.json](https://s3.us-gov-east-1.amazonaws.com/cfn-resource-specifications-us-gov-east-1-prod/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://s3.us-gov-east-1.amazonaws.com/cfn-resource-specifications-us-gov-east-1-prod/latest/CloudFormationResourceSpecification.zip)  | 
|  Amazon GovCloud（美国西部）  |  `us-gov-west-1`  |  [.json](https://s3.us-gov-west-1.amazonaws.com/cfn-resource-specifications-us-gov-west-1-prod/latest/CloudFormationResourceSpecification.json)  |  [.zip](https://s3.us-gov-west-1.amazonaws.com/cfn-resource-specifications-us-gov-west-1-prod/latest/CloudFormationResourceSpecification.zip)  | 

以下示例显示 Amazon Key Management Service 键资源 (`AWS::KMS::Key`) 的规范。它显示了 `AWS::KMS::Key` 资源的属性、哪些属性是必需的、每个属性允许的值的类型以及属性的更新行为。有关此规范的详细信息，请参阅[规范格式](cfn-resource-specification-format.md)。

```
    "AWS::KMS::Key": {
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
      },
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html",
      "Properties": {
        "Description": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-description",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "EnableKeyRotation": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enablekeyrotation",
          "PrimitiveType": "Boolean",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "Enabled": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enabled",
          "PrimitiveType": "Boolean",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "KeyPolicy": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keypolicy",
          "PrimitiveType": "Json",
          "Required": true,
          "UpdateType": "Mutable"
        },
        "KeyUsage": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keyusage",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Immutable"
        }
      }
    }
```

# 规范格式


CloudFormation 为每种资源类型（如 `AWS::S3::Bucket` 或 `AWS::EC2::Instance`）创建一个规范。以下部分介绍了格式和此规范内的每个字段。

**Topics**
+ [

## 规范部分
](#w2aac37b9c23b7)
+ [

## 属性规范
](#cfn-resource-specification-format-propertytypes)
+ [

## 资源规范
](#cfn-resource-specification-format-resourcetype)
+ [

## 示例资源规范
](#w2aac37b9c23c13)

## 规范部分


每个资源类型的正式定义组织成三个主要部分：`PropertyTypes`、`ResourceSpecificationVersion` 和 `ResourceTypes`，如以下示例所示：

```
{
  "PropertyTypes": {
    *Property specifications*
  },
  "ResourceSpecificationVersion": "Specification version number",
  "ResourceTypes": {
    *Resource specification*
  }
}
```

`PropertyTypes`  <a name="specification-section-property-types"></a>
对于具有某个属性中的属性 (又称为子属性) 的资源，为一个子属性规范列表，例如哪些属性是必需的，每个属性允许的值的类型以及属性的更新行为。有关更多信息，请参阅 [属性规范](#cfn-resource-specification-format-propertytypes)。  
如果资源没有子属性，则忽略此部分。

`ResourceSpecificationVersion`  <a name="specification-section-resource-version"></a>
资源规范的版本。版本格式为 `majorVersion.minorVersion.patch`，其中，每个版本会增加版本号。所有资源都具有相同的版本号，无论资源是否已更新。  
CloudFormation 在服务进行向后兼容的错误修复（如修复断开的文档链接）时会递增补丁版本号。当 CloudFormation 添加向后兼容的资源或属性时，将递增次要版本号。例如，更高版本的规范可能添加其他资源属性以支持 Amazon 服务的新功能。  
向后兼容的更改会增加主要版本号。向后兼容的更改可能是由资源规范中的更改 (如字段的名称更改) 或资源更改 (如将可选资源属性设置为必需属性) 导致的。

`ResourceTypes`  <a name="specification-section-resource-types"></a>
资源列表以及有关每个资源的属性的信息，例如，资源的属性名称、哪些属性是必需的以及属性的更新行为。有关更多信息，请参阅 [资源规范](#cfn-resource-specification-format-resourcetype)。  
如果您查看包含一种资源类型定义的文件，则属性名称为 `ResourceType` (单数)。

## 属性规范


每个属性的规范均包含以下字段。对于子属性，属性名称使用 `resourceType.subpropertyName` 格式。

```
"Property name": {
  "Documentation": "Link to the relevant documentation"
  "DuplicatesAllowed": "true or false",
  "ItemType": "Type of list or map (non-primitive)",
  "PrimitiveItemType": "Type of list or map (primitive)",
  "PrimitiveType": "Type of value (primitive)",
  "Required": "true or false",
  "Type": "Type of value (non-primitive)",
  "UpdateType": "Mutable, Immutable, or Conditional",
}
```

`Documentation`  <a name="property-specification-documentation"></a>
指向*《Amazon CloudFormation 用户指南》*的链接，其中提供有关属性的信息。

`DuplicatesAllowed`  <a name="property-specification-duplicates-allowed"></a>
如果 `Type` 字段的值为 `List`，则指示 CloudFormation 是否允许使用重复值。如果值为 `true`，CloudFormation 将忽略重复值。如果值为 `false`，则 CloudFormation 在您提交重复值时返回错误。

`ItemType`  <a name="property-specification-item-type"></a>
如果 `Type` 字段的值为 `List` 或 `Map`，则指示列表或映射的类型 (如果它们包含非基元类型)。否则，将忽略该字段。对于包含基元类型的列表或映射，`PrimitiveItemType` 属性指示有效值类型。  
子属性名称是有效项目类型。例如，如果类型值为 `List` 且项目类型值为 `PortMapping`，则您可指定端口映射属性的列表。

`PrimitiveItemType`  <a name="property-specification-primitive-item-type"></a>
如果 `Type` 字段的值为 `List` 或 `Map`，则指示列表或映射的类型 (如果它们包含基元类型)。否则，将忽略该字段。对于包含非基元类型的列表或映射，`ItemType` 属性指示有效值类型。  
列表和映射的有效基元类型为 `String`、`Long`、`Integer`、`Double`、`Boolean` 或 `Timestamp`。  
例如，如果类型值为 `List` 且项目类型值为 `String`，您可以指定属性的字符串列表。如果类型值为 `Map` 且项目类型值为 `Boolean`，您可以指定属性的字符串到布尔值映射。

`PrimitiveType`  <a name="property-specification-primitive-type"></a>
对于基元值，为属性的有效基元类型。基元类型是资源属性值的基本数据类型。有效基元类型为 `String`、`Long`、`Integer`、`Double`、`Boolean`、`Timestamp` 或 `Json`。如果有效值为非基元类型，则将忽略该字段，并且 `Type` 字段指示有效值类型。

`Required`  <a name="property-specification-required"></a>
指示属性是否为必需属性。

`Type`  <a name="property-specification-type"></a>
对于非基元类型，为属性的有效值。有效类型为子属性名称、`List` 或 `Map`。如果有效值为基元类型，则将忽略该字段，并且 `PrimitiveType` 字段指示有效值类型。  
列表是值的逗号分隔列表。映射是一组键值对，其中，键始终为字符串。列表和映射的值类型由 `ItemType` 或 `PrimitiveItemType` 字段指示。

`UpdateType`  <a name="property-specification-update-type"></a>
在堆栈更新期间，添加、移除或修改属性时的更新行为。当您更改不可变属性时，CloudFormation 会替换该资源。当您更改可变属性时，CloudFormation 不会替换该资源。条件更新可以是可变的，也可以是不可变的，具体取决于您更新的其他属性。有关更多信息，请参阅 [Amazon 资源和属性类型参考](aws-template-resource-type-ref.md)。

## 资源规范


每个资源类型的规范均包含以下字段。

```
"Resource type name": {
  "Attributes": {
    "AttributeName": {
      "ItemType": "Return list or map type (non-primitive)",
      "PrimitiveItemType": "Return list or map type (primitive)",
      "PrimitiveType": "Return value type (primitive)",
      "Type": "Return value type (non-primitive)",
    }
  },
  "Documentation": "Link to the relevant documentation",
  "Properties": {
    *Property specifications*
  }
}
```

`Attributes`  <a name="resource-type-specification-attributes"></a>
您可在 [`Fn::GetAtt`](intrinsic-function-reference-getatt.md) 函数中使用的资源属性的列表。对于每个属性，此部分提供了属性名称和 CloudFormation 返回的值的类型。    
`ItemType`  <a name="resource-type-specification-item-type"></a>
如果 `Type` 字段的值为 `List`，则指示在列表包含非基元类型的情况下，`Fn::GetAtt` 函数为该属性返回的列表的类型。有效类型为属性的名称。  
`PrimitiveItemType`  <a name="resource-type-specification-primitive-item-type"></a>
如果 `Type` 字段的值为 `List`，则指示在列表包含基元类型的情况下，`Fn::GetAtt` 函数为该属性返回的列表的类型。对于包含非基元类型的列表，`ItemType` 属性指示有效值类型。列表的有效基元类型为 `String`、`Long`、`Integer`、`Double`、`Boolean` 或 `Timestamp`。  
例如，如果类型值为 `List` 且基元项目类型值为 `String`，则 `Fn::GetAtt` 函数返回字符串列表。  
`PrimitiveType`  <a name="resource-type-specification-primitive-type"></a>
对于基元返回值，为 `Fn::GetAtt` 函数为该属性返回的基元值的类型。基元类型是资源属性值的基本数据类型。有效基元类型为 `String`、`Long`、`Integer`、`Double`、`Boolean`、`Timestamp` 或 `Json`。  
`Type`  <a name="resource-type-specification-type"></a>
对于非基元返回值，为 `Fn::GetAtt` 函数为该属性返回的值的类型。有效类型为属性名称或 `List`。  
列表是值的逗号分隔列表。列表的值类型由 `ItemType` 或 `PrimitiveItemType` 字段指示。

`Documentation`  <a name="resource-type-specification-documentation"></a>
指向*《Amazon CloudFormation 用户指南》*的链接，其中提供有关资源的信息。

`Properties`  <a name="resource-type-specification-properties"></a>
资源的属性规范的列表。有关更多信息，请参阅 [属性规范](#cfn-resource-specification-format-propertytypes)。

## 示例资源规范


以下示例重点介绍和说明 [AWS::Elasticsearch::Domain](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/aws-resource-elasticsearch-domain.html) 资源规范的各个部分。

`AWS::Elasticsearch::Domain` 资源类型包含子属性，因此其规范包括 `PropertyTypes` 部分。此部分后跟 `ResourceSpecificationVersion` 部分，它将规范版本显示为 `1.0.0`。在规范版本为指定资源类型的 `ResourceType` 部分后，提供文档链接并详细说明资源的属性。

```
{
  "PropertyTypes": {
    ...

  },
  "ResourceSpecificationVersion": "1.0.0",
  "ResourceType": {
    "AWS::Elasticsearch::Domain": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html",
      "Properties": {
        ...

        }
      }
    }
  }
}
```

重点关注 `ResourceType` 部分，以下示例显示 `AWS::Elasticsearch::Domain` 资源类型的两个属性。`AdvancedOptions` 属性不是必需属性，并且接受字符串到字符串映射。映射是一个键值对集合，其中，键始终为字符串。值类型由 `ItemType` 字段指示，为 `String`。因此，该类型为字符串到字符串映射。该属性的更新行为是可变的。如果更新该属性，CloudFormation 会保留资源而不是创建新资源，然后删除旧资源（不可变更新）。

`SnapshotOptions` 属性不是必需属性，并且接受名为 `SnapshotOptions` 的子属性。`SnapshotOptions` 部分提供了 `PropertyTypes` 子属性的详细信息。

```
{
  "PropertyTypes": {
    ...

  },
  "ResourceSpecificationVersion": "1.0.0",
  "ResourceType": {
    "AWS::Elasticsearch::Domain": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html",
      "Properties": {
        ...

        "AdvancedOptions": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-advancedoptions",
          "DuplicatesAllowed": false,
          "PrimitiveItemType": "String",
          "Required": false,
          "Type": "Map",
          "UpdateType": "Mutable"
        },
        ...

        "SnapshotOptions": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-snapshotoptions",
          "Required": false,
          "Type": "SnapshotOptions",
          "UpdateType": "Mutable"
        },
        ...

      }
    }
  }
}
```

在 `PropertyTypes` 中，规范列出了资源的所有子属性（包括嵌套子属性）。以下示例详细说明了 `AWS::Elasticsearch::Domain.SnapshotOptions` 子属性。它包含一个名为 `AutomatedSnapshotStartHour` 的属性，该属性不是必需属性，并且接受整数值类型。

```
"PropertyTypes": {
  ...

  "AWS::Elasticsearch::Domain.SnapshotOptions": {
    "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-snapshotoptions.html",
    "Properties": {
      "AutomatedSnapshotStartHour": {
        "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-snapshotoptions.html#cfn-elasticsearch-domain-snapshotoptions-automatedsnapshotstarthour",
        "PrimitiveType": "Integer",
        "Required": false,
        "UpdateType": "Mutable"
      }
    }
  },
  ...
    
}
```

以下示例提供了完整的 `AWS::Elasticsearch::Domain` 资源规范以供您参考。

```
{
  "PropertyTypes": {
    "AWS::Elasticsearch::Domain.EBSOptions": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-ebsoptions.html",
      "Properties": {
        "EBSEnabled": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-ebsoptions.html#cfn-elasticsearch-domain-ebsoptions-ebsenabled",
          "PrimitiveType": "Boolean",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "Iops": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-ebsoptions.html#cfn-elasticsearch-domain-ebsoptions-iops",
          "PrimitiveType": "Integer",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "VolumeSize": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-ebsoptions.html#cfn-elasticsearch-domain-ebsoptions-volumesize",
          "PrimitiveType": "Integer",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "VolumeType": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-ebsoptions.html#cfn-elasticsearch-domain-ebsoptions-volumetype",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Mutable"
        }
      }
    },
    "AWS::Elasticsearch::Domain.ElasticsearchClusterConfig": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html",
      "Properties": {
        "DedicatedMasterCount": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-dedicatedmastercount",
          "PrimitiveType": "Integer",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "DedicatedMasterEnabled": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-dedicatedmasterenabled",
          "PrimitiveType": "Boolean",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "DedicatedMasterType": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-dedicatedmastertype",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "InstanceCount": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-instancecount",
          "PrimitiveType": "Integer",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "InstanceType": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-instancetype",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "ZoneAwarenessEnabled": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-elasticsearchclusterconfig.html#cfn-elasticsearch-domain-elasticseachclusterconfig-zoneawarenessenabled",
          "PrimitiveType": "Boolean",
          "Required": false,
          "UpdateType": "Mutable"
        }
      }
    },
    "AWS::Elasticsearch::Domain.SnapshotOptions": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-snapshotoptions.html",
      "Properties": {
        "AutomatedSnapshotStartHour": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-snapshotoptions.html#cfn-elasticsearch-domain-snapshotoptions-automatedsnapshotstarthour",
          "PrimitiveType": "Integer",
          "Required": false,
          "UpdateType": "Mutable"
        }
      }
    },
    "Tag": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html",
      "Properties": {
        "Key": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key",
          "PrimitiveType": "String",
          "Required": true,
          "UpdateType": "Immutable"
        },
        "Value": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value",
          "PrimitiveType": "String",
          "Required": true,
          "UpdateType": "Immutable"
        }
      }
    }
  },
  "ResourceType": {
    "AWS::Elasticsearch::Domain": {
      "Attributes": {
        "DomainArn": {
          "PrimitiveType": "String"
        },
        "DomainEndpoint": {
          "PrimitiveType": "String"
        }
      },
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html",
      "Properties": {
        "AccessPolicies": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-accesspolicies",
          "PrimitiveType": "Json",
          "Required": false,
          "UpdateType": "Mutable"
        },
        "AdvancedOptions": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-advancedoptions",
          "DuplicatesAllowed": false,
          "PrimitiveItemType": "String",
          "Required": false,
          "Type": "Map",
          "UpdateType": "Mutable"
        },
        "DomainName": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-domainname",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Immutable"
        },
        "EBSOptions": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-ebsoptions",
          "Required": false,
          "Type": "EBSOptions",
          "UpdateType": "Mutable"
        },
        "ElasticsearchClusterConfig": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-elasticsearchclusterconfig",
          "Required": false,
          "Type": "ElasticsearchClusterConfig",
          "UpdateType": "Mutable"
        },
        "ElasticsearchVersion": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-elasticsearchversion",
          "PrimitiveType": "String",
          "Required": false,
          "UpdateType": "Immutable"
        },
        "SnapshotOptions": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-snapshotoptions",
          "Required": false,
          "Type": "SnapshotOptions",
          "UpdateType": "Mutable"
        },
        "Tags": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html#cfn-elasticsearch-domain-tags",
          "DuplicatesAllowed": true,
          "ItemType": "Tag",
          "Required": false,
          "Type": "List",
          "UpdateType": "Mutable"
        }
      }
    }
  },
  "ResourceSpecificationVersion": "1.4.1"
}
```

# CloudFormation 资源提供程序架构
资源提供程序架构

除资源规范外，CloudFormation 还针对 Amazon 资源，按照区域给出资源提供程序架构。每个资源提供程序架构都是 JSON 格式的文本文件，用于定义特定资源的属性和特性。

CloudFormation 为每个区域提供一个 zip 文件，其中包含该区域中每个可用资源的单独架构文件。要下载特定区域的资源提供程序架构，请参阅下表。您还可以使用 [CloudFormation 注册表](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/registry.html)查看资源的提供程序架构。

资源可用性可能因区域而异。要检查给定区域中某个资源的可用性，请参考该区域的资源提供程序架构。

要了解有关资源提供程序架构的更多信息（包括架构格式和定义），请参阅《CloudFormation 命令行界面用户指南》中的[资源提供程序架构](https://docs.amazonaws.cn/cloudformation-cli/latest/userguide/resource-type-schema.html)。

下表按区域列出了 Amazon 资源的可用资源提供程序架构


|   区域名称  |  区域资源提供程序架构文件  | 
| --- | --- | 
|  美国东部（俄亥俄州）  |  [https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip)  | 
|  美国东部（弗吉尼亚州北部）  |  [https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip)  | 
|  美国西部（加利福尼亚北部）  |  [https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip)  | 
|  美国西部（俄勒冈州）  |  [https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip)  | 
|  非洲（开普敦）  |  [https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（香港）  |  [https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（海得拉巴）  |  [https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（雅加达）  |  [https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（马来西亚）  |  [https://schema.cloudformation.ap-southeast-5.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-5.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（墨尔本）  |  [https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（台北）  |  [https://schema.cloudformation.ap-east-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-east-2.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（泰国）  |  [https://schema.cloudformation.ap-southeast-7.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-7.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（孟买）  |  [https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（大阪）  |  [https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（首尔）  |  [https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（新加坡）  |  [https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（悉尼）  |  [https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip)  | 
|  亚太地区（东京）  |  [https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip)  | 
|  加拿大（中部）  |  [https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip)  | 
|  加拿大西部（卡尔加里）  |  [https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip)  | 
|  中国（北京）  |  [https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip](https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip)  | 
|  中国（宁夏）  |  [https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip](https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip)  | 
|  欧洲地区（法兰克福）  |  [https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（爱尔兰）  |  [https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（伦敦）  |  [https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（米兰）  |  [https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（巴黎）  |  [https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（西班牙）  |  [https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲地区（斯德哥尔摩）  |  [https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip)  | 
|  欧洲（苏黎世）  |  [https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip)  | 
|  以色列（特拉维夫）  |  [https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip)  | 
|  中东（巴林）  |  [https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip)  | 
|  中东（阿联酋）  |  [https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip)  | 
|  墨西哥（中部）  |  [https://schema.cloudformation.mx-central-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.mx-central-1.amazonaws.com/CloudformationSchema.zip)  | 
|  南美洲（圣保罗）  |  [https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip)  | 
|  Amazon GovCloud（美国东部）  |  [https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip)  | 
|  Amazon GovCloud（美国西部）  |  [https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip](https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip)  | 