Skip to content

Commit 31bc06e

Browse files
committed
add cfn schema fetcher
1 parent 5a0a4df commit 31bc06e

18 files changed

+572954
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ fetch-schema-data:
6868
# aws-cdk updated where they store the cfn doc json files. See https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cfnspec/README.md
6969
bin/git_lfs_download.sh "https://raw.githubusercontent.com/cdklabs/awscdk-service-spec/main/sources/CloudFormationDocumentation/CloudFormationDocumentation.json"
7070

71-
curl -o .tmp/cloudformation.schema.json https://raw.githubusercontent.com/awslabs/goformation/master/schema/cloudformation.schema.json
71+
# Generate fresh CloudFormation schema using Python generator
72+
python3 schema_source/cfn_schema_generator.py
7273

7374
update-schema-data:
7475
# Parse docs

requirements-schema.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
requests>=2.25.0
2+
jinja2>=3.0.0

schema_source/cfn_schema_generator.py

Lines changed: 357 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::AutoScaling::AutoScalingGroup": {
4+
"Properties": {
5+
"MinSize": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#cfn-autoscaling-autoscalinggroup-minsize",
7+
"UpdateType": "Mutable",
8+
"Required": true,
9+
"PrimitiveType": "String"
10+
},
11+
"MaxSize": {
12+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#cfn-autoscaling-autoscalinggroup-maxsize",
13+
"UpdateType": "Mutable",
14+
"Required": true,
15+
"PrimitiveType": "String"
16+
}
17+
}
18+
}
19+
},
20+
"PropertyTypes": {}
21+
}

tests/schema/cfn_schema_generator/input_spec/full_schema.json

Lines changed: 284652 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::AIOps::InvestigationGroup": {
4+
"Properties": {
5+
"CrossAccountConfigurations": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-aiops-investigationgroup.html#cfn-aiops-investigationgroup-crossaccountconfigurations",
7+
"UpdateType": "Mutable",
8+
"Required": false,
9+
"Type": "List",
10+
"ItemType": "CrossAccountConfiguration",
11+
"DuplicatesAllowed": false
12+
}
13+
}
14+
}
15+
},
16+
"PropertyTypes": {
17+
"AWS::AIOps::InvestigationGroup.CrossAccountConfiguration": {
18+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aiops-investigationgroup-crossaccountconfiguration.html",
19+
"Properties": {
20+
"SourceRoleArn": {
21+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aiops-investigationgroup-crossaccountconfiguration.html#cfn-aiops-investigationgroup-crossaccountconfiguration-sourcerolearn",
22+
"UpdateType": "Mutable",
23+
"Required": false,
24+
"PrimitiveType": "String"
25+
}
26+
}
27+
}
28+
}
29+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::ACMPCA::CertificateAuthority": {
4+
"Properties": {
5+
"Tags": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-certificateauthority.html#cfn-acmpca-certificateauthority-tags",
7+
"UpdateType": "Mutable",
8+
"Required": false,
9+
"Type": "List",
10+
"ItemType": "Tag",
11+
"DuplicatesAllowed": true
12+
}
13+
}
14+
}
15+
},
16+
"PropertyTypes": {
17+
"Tag": {
18+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html",
19+
"Properties": {
20+
"Value": {
21+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value",
22+
"UpdateType": "Mutable",
23+
"Required": true,
24+
"PrimitiveType": "String"
25+
},
26+
"Key": {
27+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key",
28+
"UpdateType": "Mutable",
29+
"Required": true,
30+
"PrimitiveType": "String"
31+
}
32+
}
33+
}
34+
}
35+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::ARCRegionSwitch::Plan": {
4+
"Properties": {
5+
"Tags": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-arcregionswitch-plan.html#cfn-arcregionswitch-plan-tags",
7+
"UpdateType": "Mutable",
8+
"Required": false,
9+
"Type": "Map",
10+
"PrimitiveItemType": "String"
11+
}
12+
}
13+
}
14+
},
15+
"PropertyTypes": {}
16+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::Lambda::Function": {
4+
"Properties": {
5+
"Environment": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment",
7+
"UpdateType": "Mutable",
8+
"Required": false,
9+
"Type": "Environment"
10+
},
11+
"VpcConfig": {
12+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig",
13+
"UpdateType": "Mutable",
14+
"Required": false,
15+
"Type": "VpcConfig"
16+
},
17+
"DeadLetterConfig": {
18+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig",
19+
"UpdateType": "Mutable",
20+
"Required": false,
21+
"Type": "DeadLetterConfig"
22+
},
23+
"Code": {
24+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code",
25+
"UpdateType": "Mutable",
26+
"Required": true,
27+
"Type": "Code"
28+
}
29+
}
30+
}
31+
},
32+
"PropertyTypes": {
33+
"AWS::Lambda::Function.Code": {
34+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html",
35+
"Properties": {
36+
"SourceKMSKeyArn": {
37+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-sourcekmskeyarn",
38+
"UpdateType": "Mutable",
39+
"Required": false,
40+
"PrimitiveType": "String"
41+
},
42+
"S3ObjectVersion": {
43+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion",
44+
"UpdateType": "Mutable",
45+
"Required": false,
46+
"PrimitiveType": "String"
47+
},
48+
"S3Bucket": {
49+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket",
50+
"UpdateType": "Mutable",
51+
"Required": false,
52+
"PrimitiveType": "String"
53+
},
54+
"ZipFile": {
55+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile",
56+
"UpdateType": "Mutable",
57+
"Required": false,
58+
"PrimitiveType": "String"
59+
},
60+
"S3Key": {
61+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key",
62+
"UpdateType": "Mutable",
63+
"Required": false,
64+
"PrimitiveType": "String"
65+
},
66+
"ImageUri": {
67+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri",
68+
"UpdateType": "Mutable",
69+
"Required": false,
70+
"PrimitiveType": "String"
71+
}
72+
}
73+
},
74+
"AWS::Lambda::Function.DeadLetterConfig": {
75+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html",
76+
"Properties": {
77+
"TargetArn": {
78+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn",
79+
"UpdateType": "Mutable",
80+
"Required": false,
81+
"PrimitiveType": "String"
82+
}
83+
}
84+
},
85+
"AWS::Lambda::Function.VpcConfig": {
86+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html",
87+
"Properties": {
88+
"Ipv6AllowedForDualStack": {
89+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-ipv6allowedfordualstack",
90+
"UpdateType": "Mutable",
91+
"Required": false,
92+
"PrimitiveType": "Boolean"
93+
},
94+
"SecurityGroupIds": {
95+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids",
96+
"UpdateType": "Mutable",
97+
"Required": false,
98+
"Type": "List",
99+
"PrimitiveItemType": "String",
100+
"DuplicatesAllowed": true
101+
},
102+
"SubnetIds": {
103+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids",
104+
"UpdateType": "Mutable",
105+
"Required": false,
106+
"Type": "List",
107+
"PrimitiveItemType": "String",
108+
"DuplicatesAllowed": true
109+
}
110+
}
111+
},
112+
"AWS::Lambda::Function.Environment": {
113+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html",
114+
"Properties": {
115+
"Variables": {
116+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables",
117+
"UpdateType": "Mutable",
118+
"Required": false,
119+
"Type": "Map",
120+
"PrimitiveItemType": "String"
121+
}
122+
}
123+
}
124+
}
125+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"ResourceTypes": {
3+
"AWS::ACMPCA::Certificate": {
4+
"Properties": {
5+
"TemplateArn": {
6+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-certificate.html#cfn-acmpca-certificate-templatearn",
7+
"UpdateType": "Immutable",
8+
"Required": false,
9+
"PrimitiveType": "String"
10+
}
11+
}
12+
}
13+
},
14+
"PropertyTypes": {}
15+
}

0 commit comments

Comments
 (0)