Skip to content

Commit a7c365e

Browse files
authored
Merge pull request #2 from whi-tw/create-pull-request/patch
CloudFormation Template Schema upgrade
2 parents 95ec0df + 60bd465 commit a7c365e

File tree

1,397 files changed

+410683
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,397 files changed

+410683
-0
lines changed

schema/base.schema.json

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://aws.amazon.com/cloudformation/template/base",
4+
"type": "object",
5+
"definitions": {
6+
"Transform": {
7+
"type": "object",
8+
"oneOf": [
9+
{
10+
"$comment": "You can use the AWS::Include transform anywhere within the AWS CloudFormation template except in the template parameters section or the template version field. For example, you can use AWS::Include in the mappings section.",
11+
"properties": {
12+
"Name": {
13+
"type": "string",
14+
"enum": [
15+
"AWS::Include"
16+
]
17+
},
18+
"Parameters": {
19+
"type": "object",
20+
"properties": {
21+
"Location": {
22+
"$comment": "The location is an Amazon S3 URI, with a specific file name in an S3 bucket. For example, s3://MyBucketName/MyFile.yaml.",
23+
"type": "string",
24+
"format": "uri"
25+
}
26+
},
27+
"additionalProperties": false
28+
}
29+
},
30+
"additionalProperties": false
31+
},
32+
{
33+
"$comment": "Use a transform to simplify template authoring for serverless applications. ",
34+
"type": "string",
35+
"enum": [
36+
"AWS::CodeDeployBlueGreen",
37+
"AWS::CodeStar",
38+
"AWS::SecretsManager-2020-07-23",
39+
"AWS::Serverless-2016-10-31"
40+
]
41+
}
42+
]
43+
}
44+
},
45+
"additionalProperties": false,
46+
"properties": {
47+
"AWSTemplateFormatVersion": {
48+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html",
49+
"type": "string",
50+
"enum": [
51+
"2010-09-09"
52+
]
53+
},
54+
"Description": {
55+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-description-structure.html",
56+
"type": "string",
57+
"maxLength": 1024
58+
},
59+
"Metadata": {
60+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html",
61+
"type": "object"
62+
},
63+
"Parameters": {
64+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html",
65+
"$ref": "parameters.schema.json#/properties/Parameters"
66+
},
67+
"Mappings": {
68+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html",
69+
"type": "object",
70+
"patternProperties": {
71+
"^[a-zA-Z0-9._-]{1,255}$": {
72+
"$ref": "mappings.schema.json#/properties/Mappings"
73+
}
74+
},
75+
"additionalProperties": false
76+
},
77+
"Conditions": {
78+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html",
79+
"$ref": "conditions.schema.json#/properties/Conditions"
80+
},
81+
"Transform": {
82+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html",
83+
"$ref": "#/definitions/Transform"
84+
},
85+
"Outputs": {
86+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html",
87+
"type": "object"
88+
},
89+
"Resources": {
90+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html",
91+
"$ref": "resources.schema.json#/properties/Resources"
92+
},
93+
"Hooks": {
94+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html",
95+
"type": "object"
96+
},
97+
"Rules": {
98+
"description": "https://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html",
99+
"type": "object"
100+
}
101+
},
102+
"description": "CloudFormation template JSON specification",
103+
"required": [
104+
"Resources"
105+
]
106+
}

schema/conditions.schema.json

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://aws.amazon.com/cloudformation/template/conditions",
4+
"title": "Conditions",
5+
"description": "CloudFormation template JSON specification for the Conditions capability",
6+
"type": "object",
7+
"definitions": {
8+
"ConditionalExpression": {
9+
"$comment": "Intrinsic function token expression or literal value",
10+
"anyOf": [
11+
{
12+
"$comment": "Literal value",
13+
"type": "string"
14+
},
15+
{
16+
"$ref": "#/definitions/FnAnd"
17+
},
18+
{
19+
"$ref": "#/definitions/FnEquals"
20+
},
21+
{
22+
"$ref": "#/definitions/FnNot"
23+
},
24+
{
25+
"$ref": "#/definitions/FnOr"
26+
},
27+
{
28+
"$ref": "intrinsics.schema.json#/definitions/FnFindInMap"
29+
},
30+
{
31+
"$ref": "#/definitions/FnRef"
32+
}
33+
]
34+
},
35+
"FnRef": {
36+
"type": "string"
37+
},
38+
"FnAnd": {
39+
"type": "object",
40+
"properties": {
41+
"Fn::And": {
42+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-and",
43+
"type": "array",
44+
"items": {
45+
"$ref": "#/definitions/ConditionalExpression"
46+
},
47+
"minItems": 2,
48+
"maxItems": 10
49+
}
50+
},
51+
"additionalProperties": false
52+
},
53+
"FnEquals": {
54+
"type": "object",
55+
"properties": {
56+
"Fn::Equals": {
57+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-equals",
58+
"type": "array",
59+
"items": {
60+
"$ref": "#/definitions/ConditionalExpression"
61+
},
62+
"minItems": 2,
63+
"maxItems": 2
64+
}
65+
},
66+
"additionalProperties": false
67+
},
68+
"FnNot": {
69+
"type": "object",
70+
"properties": {
71+
"Fn::Not": {
72+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-not",
73+
"type": "array",
74+
"items": [
75+
{
76+
"$ref": "#/definitions/ConditionalExpression"
77+
}
78+
],
79+
"minItems": 1,
80+
"maxItems": 1
81+
}
82+
},
83+
"additionalProperties": false
84+
},
85+
"FnOr": {
86+
"type": "object",
87+
"properties": {
88+
"Fn::Or": {
89+
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-or",
90+
"type": "array",
91+
"items": {
92+
"$ref": "#/definitions/ConditionalExpression"
93+
},
94+
"minItems": 2,
95+
"maxItems": 10
96+
}
97+
},
98+
"additionalProperties": false
99+
}
100+
},
101+
"properties": {
102+
"Conditions": {
103+
"$comment": "You can use intrinsic functions, such as Fn::If, Fn::Equals, and Fn::Not, to conditionally create stack resources. These conditions are evaluated based on input parameters that you declare when you create or update a stack. After you define all your conditions, you can associate them with resources or resource properties in the Resources and Outputs sections of a template.",
104+
"type": "object",
105+
"patternProperties": {
106+
"^[a-zA-Z0-9._-]{1,255}$": {
107+
"$ref": "#/definitions/ConditionalExpression"
108+
}
109+
},
110+
"additionalProperties": false
111+
}
112+
}
113+
}

0 commit comments

Comments
 (0)