사양 형식 - AWS CloudFormation

사양 형식

AWS CloudFormation에서는 각 리소스 유형(예: AWS::S3::Bucket 또는 AWS::EC2::Instance)에 대한 사양을 생성합니다. 다음 단원에서는 사양의 형식과 각 필드에 대해 설명합니다.

사양 섹션

각 리소스 유형에 대한 공식 정의는 다음 예제와 같이 PropertyTypes, ResourceSpecificationVersion, ResourceTypes의 세 가지 기본 섹션으로 구성됩니다.

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

리소스의 속성 내에 속성(하위 속성이라고도 함)이 있는 경우 하위 속성 사양 목록(예: 필요한 속성, 각 속성에 대해 허용되는 값의 유형, 업데이트 동작)입니다. 자세한 내용은 속성 사양 단원을 참조하십시오.

리소스에 하위 속성이 없는 경우 이 섹션은 생략됩니다.

ResourceSpecificationVersion

리소스 사양의 버전입니다. 버전은 majorVersion.minorVersion.patch 형식입니다. 릴리스될 때마다 버전 번호가 증가합니다. 리소스를 업데이트했는지 여부에 상관없이 모든 리소스는 동일한 버전 번호를 갖습니다.

서비스에서 이전 버전과 호환되는 버그 수정을 수행한 경우(예: 끊어진 문서 링크 수정) AWS CloudFormation에서 패치 번호를 증가시킵니다. AWS CloudFormation에서 이전 버전과 호환되는 리소스 또는 속성을 추가할 경우 마이너 버전 번호가 증가됩니다. 예를 들어, 이후 버전의 사양에서 AWS 서비스의 새로운 기능을 지원하기 위해 추가 리소스 속성을 추가할 수 있습니다.

이전 버전과 호환되지 않는 변경 사항은 메이저 버전 번호를 증가시킵니다. 이전 버전과 호환되지 않는 변경은 리소스 사양 변경(예: 필드에 대한 이름 변경, 리소스 변경, 선택적 리소스 속성을 필수 항목으로 설정) 때문일 수 있습니다.

ResourceTypes

각 리소스의 속성에 대한 정보 및 리소스 목록(예: 속성 이름, 필요한 속성, 업데이트 동작)입니다. 자세한 내용은 리소스 사양 단원을 참조하십시오.

참고

한 리소스 유형에 대한 정의를 포함하는 파일의 경우 이 속성 이름은 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

속성에 대한 정보를 제공하는 AWS CloudFormation 사용 설명서 링크입니다.

DuplicatesAllowed

Type 필드의 값이 List인 경우 AWS CloudFormation에서 중복 값을 허용하는지 여부를 나타냅니다. 값이 true이면 AWS CloudFormation에서 중복 값을 무시합니다. 값이 false인 경우 중복 값을 제출하면 AWS CloudFormation에서 오류를 반환합니다.

ItemType

Type 필드 값이 List 또는 Map인 경우 목록 또는 맵(비 프리미티브 유형을 포함하는 경우)의 유형을 나타냅니다. 그렇지 않은 경우 이 필드가 생략됩니다. 목록 또는 맵에 프리미티브 유형이 포함되어 있는 경우 PrimitiveItemType 속성은 유효한 값 유형을 나타냅니다.

하위 속성 이름은 유효한 항목 유형입니다. 예를 들어, 유형 값이 List이고 항목 유형 값이 PortMapping인 경우 포트 매핑 속성 목록을 지정할 수 있습니다.

PrimitiveItemType

Type 필드 값이 List 또는 Map인 경우 목록 또는 맵(프리미티브 유형을 포함하는 경우)의 유형을 나타냅니다. 그렇지 않은 경우 이 필드가 생략됩니다. 목록 또는 맵에 비 프리미티브 유형이 포함되어 있는 경우 ItemType 속성은 유효한 값 유형을 나타냅니다.

목록 및 맵에 유효한 프리미티브 유형은 String, Long, Integer, Double, Boolean 또는 Timestamp입니다.

예를 들어, 유형 값이 List이고 항목 유형 값이 String인 경우 속성에 대한 문자열 목록을 지정할 수 있습니다. 유형 값이 Map이고 항목 유형 값이 Boolean인 경우 속성에 대해 문자열과 부울 간 매핑을 지정할 수 있습니다.

PrimitiveType

프리미티브 값의 경우 속성에 대해 유효한 프리미티브 유형입니다. 프리미티브 유형은 리소스 속성 값에 대한 기본 데이터 형식입니다. 유효한 프리미티브 유형은 String, Long, Integer, Double, Boolean, Timestamp 또는 Json입니다. 유효한 값이 프리미티브 유형이 아닌 경우 이 필드는 생략되고 Type 필드에 유효한 값 유형이 표시됩니다.

Required

속성이 필요한지 여부를 나타냅니다.

Type

비 프리미티브 유형의 경우 속성에 대해 유효한 값입니다. 유효한 유형은 하위 속성 이름 List 또는 Map입니다. 유효한 값이 프리미티브 유형인 경우 이 필드는 생략되고 PrimitiveType 필드에 유효한 값 유형이 표시됩니다.

목록은 쉼표로 구분된 값 목록입니다. 맵은 키-값 페어 세트입니다. 여기서 키는 항상 문자열입니다. 목록 및 맵에 대한 값 유형은 ItemType 또는 PrimitiveItemType 필드에 표시됩니다.

UpdateType

스택 업데이트 중에 속성을 추가, 제거 또는 수정할 때의 업데이트 동작입니다. AWS CloudFormation에서는 변경 불가능한 속성이 변경되면 리소스를 교체합니다. AWS CloudFormation에서는 변경 가능한 속성이 변경되면 리소스를 교체하지 않습니다. 예를 들어, 업데이트되는 다른 속성에 따라 조건부 업데이트가 변경 가능하거나 변경 불가능할 수 있습니다. 자세한 내용은 관련 리소스 유형 문서를 참조하십시오.

리소스 사양

각 리소스 유형에 대한 사양은 다음 필드를 포함합니다.

"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

Fn::GetAtt 함수에서 사용할 수 있는 리소스 속성 목록입니다. 각 속성에 대해 이 섹션에는 속성 이름과 AWS CloudFormation에서 반환되는 값의 유형이 제공됩니다.

ItemType

Type 필드 값이 List인 경우 목록에 비 프리미티브 유형이 포함되어 있을 때 Fn::GetAtt 함수가 속성에 대해 반환하는 목록의 유형을 나타냅니다. 유효한 유형은 속성의 이름입니다.

PrimitiveItemType

Type 필드 값이 List인 경우 목록에 프리미티브 유형이 포함되어 있을 때 Fn::GetAtt 함수가 속성에 대해 반환하는 목록의 유형을 나타냅니다. 목록에 비 프리미티브 유형이 포함되어 있는 경우 ItemType 속성은 유효한 값 유형을 나타냅니다. 목록에 유효한 프리미티브 유형은 String, Long, Integer, Double, Boolean 또는 Timestamp입니다.

예를 들어, 유형 값이 List이고 프리미티브 항목 유형 값이 String인 경우 Fn::GetAtt 함수는 문자열 목록을 반환합니다.

PrimitiveType

프리미티브 반환 값의 경우 Fn::GetAtt 함수가 속성에 대해 반환하는 프리미티브 값의 유형입니다. 프리미티브 유형은 리소스 속성 값에 대한 기본 데이터 형식입니다. 유효한 프리미티브 유형은 String, Long, Integer, Double, Boolean, Timestamp 또는 Json입니다.

Type

비 프리미티브 반환 값의 경우 Fn::GetAtt 함수가 속성에 대해 반환하는 프리미티브 값의 유형입니다. 유효한 유형은 속성 이름 또는 List입니다.

목록은 쉼표로 구분된 값 목록입니다. 목록에 대한 값 유형은 ItemType 또는 PrimitiveItemType 필드에 표시됩니다.

Documentation

리소스에 대한 정보를 제공하는 AWS CloudFormation 사용 설명서 링크입니다.

Properties

리소스에 대한 속성 사양 목록입니다. 세부 정보는 속성 사양을 참조하세요.

예제 리소스 사양

다음 예에서는 AWS::Elasticsearch::Domain 리소스 사양의 각 부분을 강조하고 설명합니다.

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). 따라서 유형은 문자열 간 매핑입니다. 이 속성에 대한 업데이트 동작은 변경 가능합니다. 이 속성을 업데이트할 경우 AWS 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" }