Skip to content

Commit 5fe5c75

Browse files
committed
Baseline for cfn-lint for a Macro (wip)
1 parent 5f6f2c5 commit 5fe5c75

File tree

6 files changed

+564
-27
lines changed

6 files changed

+564
-27
lines changed

‎.cfnlintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
override_spec: spec/elendel.network.vpc.wip.json
2+
templates:
3+
- example.yaml
4+
regions:
5+
- ap-southeast-2
6+
include_checks:
7+
- I
8+
ignore_checks:
9+
- W2001

‎example.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ Parameters:
55
Mappings: {}
66
Resources:
77

8-
KABLAMOBUILDVPC:
9-
Type: Kablamo::Network::VPC
8+
ELENDELVPC:
9+
Type: Elendel::Network::VPC
1010
Properties:
1111
CIDR: 172.16.0.0/20
12-
Details: {VPCName: PRIVATEEGRESSVPC, VPCDesc: Private Egress VPC, Region: ap-southeast-2, IPv6: True}
12+
Details: {VPCName: PRIVATEEGRESSVPC, VPCDesc: Private Egress VPC, Region: ap-southeast-2, IPv6: true}
1313
Tags: {Name: PRIVATE-EGRESS-VPC, Template: VPC for private endpoints egress only}
1414
DHCP: {Name: DhcpOptions, DNSServers: 172.16.0.2, NTPServers: 169.254.169.123, NTBType: 2}
1515
TransitGateways:
16-
Test1:
17-
TransitGatewayId: tgw-01234567890123456
18-
Tags: {Name: PRIVATE-EGRESS-VPC-TGW1, Purpose: Gateway Attach 1}
19-
Subnets:
20-
- Internal1
21-
- Internal2
22-
- Internal3
23-
Test2:
24-
TransitGatewayId: tgw-98765432109876543
25-
Tags: {Name: PRIVATE-EGRESS-VPC-TGW2, Purpose: Gateway Attach 2}
26-
Subnets:
27-
- Internal1
28-
- Internal2
29-
- Internal3
16+
Test1:
17+
TransitGatewayId: tgw-01234567890123456
18+
Tags: {Name: PRIVATE-EGRESS-VPC-TGW1, Purpose: Gateway Attach 1}
19+
Subnets:
20+
- Internal1
21+
- Internal2
22+
- Internal3
23+
Test2:
24+
TransitGatewayId: tgw-98765432109876543
25+
Tags: {Name: PRIVATE-EGRESS-VPC-TGW2, Purpose: Gateway Attach 2}
26+
Subnets:
27+
- Internal1
28+
- Internal2
29+
- Internal3
3030
Subnets:
3131
ReservedMgmt1: {CIDR: 172.16.0.0/26, AZ: 0, NetACL: InternalSubnetAcl, RouteTable: InternalRT1 }
3232
ReservedMgmt2: {CIDR: 172.16.1.0/26, AZ: 1, NetACL: InternalSubnetAcl, RouteTable: InternalRT2 }
@@ -42,15 +42,15 @@ Resources:
4242
PerimeterInternal3: {CIDR: 172.16.8.0/24, AZ: 2, NetACL: InternalSubnetAcl, RouteTable: InternalRT3 }
4343
RouteTables:
4444
PublicRT:
45-
- RouteName: PublicRoute
46-
RouteCIDR: 0.0.0.0/0
47-
RouteGW: InternetGateway
48-
- RouteName: PublicRouteIPv6
49-
RouteCIDR: ::/0
50-
RouteGW: InternetGateway
51-
InternalRT1:
52-
InternalRT2:
53-
InternalRT3:
45+
- RouteName: PublicRoute
46+
RouteCIDR: 0.0.0.0/0
47+
RouteGW: InternetGateway
48+
- RouteName: PublicRouteIPv6
49+
RouteCIDR: "::/0"
50+
RouteGW: InternetGateway
51+
InternalRT1: {}
52+
InternalRT2: {}
53+
InternalRT3: {}
5454
NATGateways:
5555
NATGW1:
5656
{Subnet: ReservedNet1, Routetable: InternalRT1}

‎spec/elendel.network.vpc.json

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
{
2+
"PropertyTypes": {
3+
"AWS::Network::VPC.VPCBuilderDetails": {
4+
"VPCName": {
5+
"PrimitiveType": "String",
6+
"Required": true,
7+
"UpdateType": "Immutable"
8+
},
9+
"VPCDesc": {
10+
"PrimitiveType": "String",
11+
"Required": true,
12+
"UpdateType": "Mutable"
13+
},
14+
"Region": {
15+
"PrimitiveType": "String",
16+
"Required": true,
17+
"UpdateType": "Immutable"
18+
},
19+
"IPv6": {
20+
"PrimitiveType": "Boolean",
21+
"Required": false,
22+
"UpdateType": "Immutable"
23+
}
24+
},
25+
"AWS::Network::VPC.VPCBuilderDHCP": {
26+
"Name": {
27+
"PrimitiveType": "String",
28+
"Required": true,
29+
"UpdateType": "Immutable"
30+
},
31+
"DNSServers": {
32+
"PrimitiveType": "String",
33+
"Required": true,
34+
"UpdateType": "Immutable"
35+
},
36+
"NTPServers": {
37+
"PrimitiveType": "String",
38+
"Required": true,
39+
"UpdateType": "Immutable"
40+
},
41+
"NTBType": {
42+
"PrimitiveType": "Boolean",
43+
"Required": false,
44+
"UpdateType": "Immutable"
45+
}
46+
},
47+
"AWS::Network::VPC.VPCBuilderTransitGateways": {
48+
"TransitGatwayId": {
49+
"PrimitiveType": "String",
50+
"Required": true,
51+
"UpdateType": "Immutable"
52+
},
53+
"Subnets": {
54+
"PrimitiveType": "String",
55+
"Required": true,
56+
"UpdateType": "Immutable"
57+
},
58+
"Tags": {
59+
"PrimitiveItemType": "String",
60+
"Required": false,
61+
"Type": "Map",
62+
"UpdateType": "Immutable"
63+
}
64+
},
65+
"AWS::Network::VPC.VPCBuilderSubnets": {
66+
"CIDR": {
67+
"PrimitiveType": "String",
68+
"Required": true,
69+
"UpdateType": "Immutable"
70+
},
71+
"AZ": {
72+
"PrimitiveType": "Integer",
73+
"Required": true,
74+
"UpdateType": "Immutable"
75+
},
76+
"NetACL": {
77+
"PrimitiveType": "String",
78+
"Required": true,
79+
"UpdateType": "Immutable"
80+
},
81+
"RouteTable": {
82+
"PrimitiveType": "String",
83+
"Required": true,
84+
"UpdateType": "Immutable"
85+
}
86+
},
87+
"AWS::Network::VPC.VPCBuilderRouteTables": {
88+
"RouteName": {
89+
"ItemType": "List",
90+
"Required": false,
91+
"Type": "VPCBuilderRoute",
92+
"UpdateType": "Immutable"
93+
}
94+
},
95+
"AWS::Network::VPC.VPCBuilderRoute": {
96+
"RouteName": {
97+
"PrimitiveType": "String",
98+
"Required": true,
99+
"UpdateType": "Immutable"
100+
},
101+
"RouteCIDR": {
102+
"PrimitiveType": "String",
103+
"Required": true,
104+
"UpdateType": "Immutable"
105+
},
106+
"RouteGW": {
107+
"PrimitiveType": "String",
108+
"Required": true,
109+
"UpdateType": "Immutable"
110+
}
111+
},
112+
"AWS::Network::VPC.VPCBuilderNATGateways": {
113+
"Subnet": {
114+
"PrimitiveType": "String",
115+
"Required": true,
116+
"UpdateType": "Immutable"
117+
},
118+
"Routetable": {
119+
"PrimitiveType": "String",
120+
"Required": true,
121+
"UpdateType": "Immutable"
122+
}
123+
},
124+
"AWS::Network::VPC.VPCBuilderSecurityGroups": {
125+
"GroupDescription": {
126+
"PrimitiveType": "String",
127+
"Required": true,
128+
"UpdateType": "Immutable"
129+
},
130+
"SecurityGroupIngress": {
131+
"PrimitiveType": "List",
132+
"ItemType": "Rule",
133+
"Required": true,
134+
"UpdateType": "Immutable"
135+
},
136+
"SecurityGroupEgress": {
137+
"PrimitiveType": "List",
138+
"ItemType": "Rule",
139+
"Required": true,
140+
"UpdateType": "Immutable"
141+
},
142+
"Tags": {
143+
"PrimitiveItemType": "String",
144+
"Required": false,
145+
"Type": "Map",
146+
"UpdateType": "Immutable"
147+
}
148+
},
149+
"AWS::Network::VPC.VPCBuilderSecurityGroups.Rule": {
150+
"GroupDescription": {
151+
"PrimitiveType": "String",
152+
"Required": true,
153+
"UpdateType": "Immutable"
154+
}
155+
},
156+
"AWS::Network::VPC.VPCBuilderEndpoints": {
157+
"Type": {
158+
"PrimitiveType": "String",
159+
"Required": true,
160+
"UpdateType": "Immutable"
161+
},
162+
"SubnetIds": {
163+
"PrimitiveType": "List",
164+
"ItemType": "String",
165+
"Required": false,
166+
"UpdateType": "Immutable"
167+
},
168+
"SecurityGroupIds": {
169+
"PrimitiveType": "List",
170+
"ItemType": "String",
171+
"Required": false,
172+
"UpdateType": "Immutable"
173+
},
174+
"RouteTableIds": {
175+
"PrimitiveType": "List",
176+
"ItemType": "String",
177+
"Required": false,
178+
"UpdateType": "Immutable"
179+
},
180+
"PolicyDocument": {
181+
"PrimitiveType": "Json",
182+
"Required": false,
183+
"UpdateType": "Immutable"
184+
}
185+
}
186+
},
187+
"ResourceTypes": {
188+
"AWS::Network::VPC": {
189+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html",
190+
"Properties": {
191+
"CIDR": {
192+
"Type": "String",
193+
"Required": true,
194+
"UpdateType": "Immutable"
195+
},
196+
"Details": {
197+
"Type": "VPCBuilderDetails",
198+
"Required": true,
199+
"UpdateType": "Mutable"
200+
},
201+
"Tags": {
202+
"PrimitiveItemType": "String",
203+
"Required": false,
204+
"Type": "Map",
205+
"UpdateType": "Immutable"
206+
},
207+
"DHCP": {
208+
"Type": "VPCBuilderDHCP",
209+
"Required": true,
210+
"UpdateType": "Mutable"
211+
},
212+
"TransitGareways": {
213+
"PrimitiveItemType": "Map",
214+
"Type": "VPCBuilderTransitGateways",
215+
"Required": true,
216+
"UpdateType": "Mutable"
217+
},
218+
"Subnets": {
219+
"PrimitiveItemType": "Map",
220+
"Type": "VPCBuilderSubnets",
221+
"Required": true,
222+
"UpdateType": "Mutable"
223+
},
224+
"RouteTables": {
225+
"PrimitiveItemType": "Map",
226+
"Type": "VPCBuilderRouteTables",
227+
"Required": true,
228+
"UpdateType": "Mutable"
229+
},
230+
"NATGateways": {
231+
"PrimitiveItemType": "Map",
232+
"Type": "VPCBuilderNATGateways",
233+
"Required": true,
234+
"UpdateType": "Mutable"
235+
},
236+
"SecurityGroups": {
237+
"PrimitiveItemType": "Map",
238+
"Type": "VPCBuilderSecurityGroups",
239+
"Required": true,
240+
"UpdateType": "Mutable"
241+
},
242+
"Endpoints": {
243+
"PrimitiveItemType": "Map",
244+
"Type": "VPCBuilderEndpoints",
245+
"Required": true,
246+
"UpdateType": "Mutable"
247+
},
248+
"NetworkACLs": {
249+
"PrimitiveItemType": "Map",
250+
"ItemType": "Map",
251+
"Required": true,
252+
"UpdateType": "Mutable"
253+
}
254+
}
255+
}
256+
},
257+
"ResourceSpecificationVersion": "0.0.1"
258+
}

‎spec/elendel.network.vpc.simple.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"ResourceTypes": {
3+
"Elendel::Network::VPC": {
4+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html",
5+
"Properties": {
6+
"CIDR": {
7+
"Required": true
8+
},
9+
"Details": {
10+
"Required": true
11+
},
12+
"Tags": {
13+
"Required": false
14+
},
15+
"DHCP": {
16+
"Required": true
17+
},
18+
"TransitGateways": {
19+
"Required": true
20+
},
21+
"Subnets": {
22+
"Required": true
23+
},
24+
"RouteTables": {
25+
"Required": true
26+
},
27+
"NATGateways": {
28+
"Required": true
29+
},
30+
"SecurityGroups": {
31+
"Required": true
32+
},
33+
"Endpoints": {
34+
"Required": true
35+
},
36+
"NetworkACLs": {
37+
"Required": true
38+
}
39+
}
40+
}
41+
},
42+
"ResourceSpecificationVersion": "0.0.1"
43+
}

0 commit comments

Comments
 (0)