Skip to content

Commit cd996cc

Browse files
authored
Merge pull request #5 from ElendelOSS/lint-spec
Lint spec
2 parents 5f6f2c5 + ac679a2 commit cd996cc

20 files changed

+7016
-2486
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

‎.codebuild/buildspec.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
commands:
6+
- pip install -r requirements_test.txt
7+
finally:
8+
- command
9+
- command
10+
pre_build:
11+
commands:
12+
- pytest --cov=src
13+
- pycodestyle --ignore=E501 .
14+
finally:
15+
- coveralls

‎.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
kombustion.yaml
22
*.zip
3-
*.pyc
4-
*/*.pyc
3+
*.__pycache__
4+
__pycache__
5+
.cache
56
*~
7+
*.pyc
68
*.swp
79
.coverage
810
coverage*

‎example.yaml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,32 @@ Parameters:
44
VGW: {Description: VPC Gateway, Type: String, Default: vgw-012345678}
55
Mappings: {}
66
Resources:
7-
8-
KABLAMOBUILDVPC:
9-
Type: Kablamo::Network::VPC
7+
ELENDELVPC:
8+
Type: Elendel::Network::VPC
109
Properties:
1110
CIDR: 172.16.0.0/20
12-
Details: {VPCName: PRIVATEEGRESSVPC, VPCDesc: Private Egress VPC, Region: ap-southeast-2, IPv6: True}
11+
Details:
12+
VPCName: PRIVATEEGRESSVPC
13+
VPCDesc: Private Egress VPC
14+
Region: ap-southeast-2
15+
IPv6: True
1316
Tags: {Name: PRIVATE-EGRESS-VPC, Template: VPC for private endpoints egress only}
1417
DHCP: {Name: DhcpOptions, DNSServers: 172.16.0.2, NTPServers: 169.254.169.123, NTBType: 2}
1518
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
19+
Test1:
20+
TransitGatewayId: tgw-01234567890123456
21+
Tags: {Name: PRIVATE-EGRESS-VPC-TGW1, Purpose: Gateway Attach 1}
22+
Subnets:
23+
- Internal1
24+
- Internal2
25+
- Internal3
26+
Test2:
27+
TransitGatewayId: tgw-98765432109876543
28+
Tags: {Name: PRIVATE-EGRESS-VPC-TGW2, Purpose: Gateway Attach 2}
29+
Subnets:
30+
- Internal1
31+
- Internal2
32+
- Internal3
3033
Subnets:
3134
ReservedMgmt1: {CIDR: 172.16.0.0/26, AZ: 0, NetACL: InternalSubnetAcl, RouteTable: InternalRT1 }
3235
ReservedMgmt2: {CIDR: 172.16.1.0/26, AZ: 1, NetACL: InternalSubnetAcl, RouteTable: InternalRT2 }
@@ -42,22 +45,19 @@ Resources:
4245
PerimeterInternal3: {CIDR: 172.16.8.0/24, AZ: 2, NetACL: InternalSubnetAcl, RouteTable: InternalRT3 }
4346
RouteTables:
4447
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:
48+
- RouteName: PublicRoute
49+
RouteCIDR: 0.0.0.0/0
50+
RouteGW: InternetGateway
51+
- RouteName: PublicRouteIPv6
52+
RouteCIDR: "::/0"
53+
RouteGW: InternetGateway
54+
InternalRT1: {}
55+
InternalRT2: {}
56+
InternalRT3: {}
5457
NATGateways:
55-
NATGW1:
56-
{Subnet: ReservedNet1, Routetable: InternalRT1}
57-
NATGW2:
58-
{Subnet: ReservedNet2, Routetable: InternalRT2}
59-
NATGW3:
60-
{Subnet: ReservedNet3, Routetable: InternalRT3}
58+
NATGW1: {Subnet: ReservedNet1, Routetable: InternalRT1}
59+
NATGW2: {Subnet: ReservedNet2, Routetable: InternalRT2}
60+
NATGW3: {Subnet: ReservedNet3, Routetable: InternalRT3}
6161
SecurityGroups:
6262
VPCEndpoint:
6363
GroupDescription: VPC Endpoint Interface Firewall Rules

‎requirements_test.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ pycodestyle==2.2.0
66
coverage==4.3.4
77
pynt==0.8.1
88
pyyaml>=4.2b1
9-
coveralls==1.5.1
9+
coveralls==1.5.1
10+
awscli>=1.16.85
11+
cfn-lint>=0.11.1

‎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+
}

0 commit comments

Comments
 (0)