cfn-model 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/bin/cfn_parse +8 -0
  3. data/lib/cfn-model/model/bucket_policy.rb +13 -0
  4. data/lib/cfn-model/model/cfn_model.rb +64 -0
  5. data/lib/cfn-model/model/ec2_instance.rb +15 -0
  6. data/lib/cfn-model/model/ec2_network_interface.rb +18 -0
  7. data/lib/cfn-model/model/iam_group.rb +15 -0
  8. data/lib/cfn-model/model/iam_managed_policy.rb +14 -0
  9. data/lib/cfn-model/model/iam_policy.rb +14 -0
  10. data/lib/cfn-model/model/iam_role.rb +14 -0
  11. data/lib/cfn-model/model/iam_user.rb +16 -0
  12. data/lib/cfn-model/model/iam_user_to_group_addition.rb +10 -0
  13. data/lib/cfn-model/model/load_balancer.rb +37 -0
  14. data/lib/cfn-model/model/model_element.rb +101 -0
  15. data/lib/cfn-model/model/policy.rb +10 -0
  16. data/lib/cfn-model/model/policy_document.rb +52 -0
  17. data/lib/cfn-model/model/principal.rb +34 -0
  18. data/lib/cfn-model/model/queue_policy.rb +13 -0
  19. data/lib/cfn-model/model/references.rb +52 -0
  20. data/lib/cfn-model/model/security_group.rb +18 -0
  21. data/lib/cfn-model/model/security_group_egress.rb +29 -0
  22. data/lib/cfn-model/model/security_group_ingress.rb +38 -0
  23. data/lib/cfn-model/model/statement.rb +38 -0
  24. data/lib/cfn-model/model/topic_policy.rb +13 -0
  25. data/lib/cfn-model/parser/cfn_parser.rb +126 -0
  26. data/lib/cfn-model/parser/ec2_instance_parser.rb +10 -0
  27. data/lib/cfn-model/parser/ec2_network_interface_parser.rb +10 -0
  28. data/lib/cfn-model/parser/iam_group_parser.rb +17 -0
  29. data/lib/cfn-model/parser/iam_role_parser.rb +20 -0
  30. data/lib/cfn-model/parser/iam_user_parser.rb +58 -0
  31. data/lib/cfn-model/parser/load_balancer_parser.rb +10 -0
  32. data/lib/cfn-model/parser/load_balancer_v2_parser.rb +15 -0
  33. data/lib/cfn-model/parser/parser_error.rb +13 -0
  34. data/lib/cfn-model/parser/parser_registry.rb +34 -0
  35. data/lib/cfn-model/parser/policy_document_parser.rb +44 -0
  36. data/lib/cfn-model/parser/security_group_parser.rb +83 -0
  37. data/lib/cfn-model/parser/with_policy_document_parser.rb +10 -0
  38. data/lib/cfn-model/schema/AWS_CloudFront_Distribution.yml +42 -0
  39. data/lib/cfn-model/schema/AWS_EC2_Instance.yml +146 -0
  40. data/lib/cfn-model/schema/AWS_EC2_NetworkInterface.yml +62 -0
  41. data/lib/cfn-model/schema/AWS_EC2_NetworkInterfaceAttachment.yml +24 -0
  42. data/lib/cfn-model/schema/AWS_EC2_SecurityGroup.yml +71 -0
  43. data/lib/cfn-model/schema/AWS_EC2_SecurityGroupEgress.yml +27 -0
  44. data/lib/cfn-model/schema/AWS_EC2_SecurityGroupIngress.yml +27 -0
  45. data/lib/cfn-model/schema/AWS_ElasticLoadBalancingV2_LoadBalancer.yml +56 -0
  46. data/lib/cfn-model/schema/AWS_ElasticLoadBalancing_LoadBalancer.yml +188 -0
  47. data/lib/cfn-model/schema/AWS_IAM_Group.yml +23 -0
  48. data/lib/cfn-model/schema/AWS_IAM_ManagedPolicy.yml +34 -0
  49. data/lib/cfn-model/schema/AWS_IAM_Policy.yml +36 -0
  50. data/lib/cfn-model/schema/AWS_IAM_Role.yml +28 -0
  51. data/lib/cfn-model/schema/AWS_IAM_User.yml +38 -0
  52. data/lib/cfn-model/schema/AWS_IAM_UserToGroupAddition.yml +23 -0
  53. data/lib/cfn-model/schema/AWS_Lambda_Permission.yml +24 -0
  54. data/lib/cfn-model/schema/AWS_S3_BucketPolicy.yml +21 -0
  55. data/lib/cfn-model/schema/AWS_SNS_TopicPolicy.yml +23 -0
  56. data/lib/cfn-model/schema/AWS_SQS_QueuePolicy.yml +23 -0
  57. data/lib/cfn-model/schema/schema.yml.erb +17 -0
  58. data/lib/cfn-model/validator/cloudformation_validator.rb +12 -0
  59. data/lib/cfn-model/validator/reference_validator.rb +83 -0
  60. data/lib/cfn-model/validator/resource_type_validator.rb +34 -0
  61. data/lib/cfn-model/validator/schema_generator.rb +86 -0
  62. data/lib/cfn-model.rb +2 -0
  63. metadata +120 -0
@@ -0,0 +1,62 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::EC2::NetworkInterface/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ # sigh this could be List<AWS::EC2::SecurityGroup::Id> so can't enfore seq
13
+ GroupSet:
14
+ type: any
15
+ required: no
16
+
17
+ Ipv6Addresses:
18
+ type: seq
19
+ required: no
20
+ sequence:
21
+ - type: map
22
+ mapping:
23
+ Ipv6Address:
24
+ type: any
25
+ required: yes
26
+ =:
27
+ type: any
28
+ PrivateIpAddresses:
29
+ type: seq
30
+ required: no
31
+ sequence:
32
+ - type: map
33
+ mapping:
34
+ PrivateIpAddress:
35
+ type: any
36
+ required: yes
37
+ Primary:
38
+ type: any
39
+ required: yes
40
+ =:
41
+ type: any
42
+ SubnetId:
43
+ type: any
44
+ required: yes
45
+ Tags:
46
+ type: seq
47
+ required: no
48
+ sequence:
49
+ - type: map
50
+ mapping:
51
+ Key:
52
+ type: any
53
+ required: yes
54
+ Value:
55
+ type: any
56
+ required: yes
57
+ =:
58
+ type: any
59
+ =:
60
+ type: any
61
+ =:
62
+ type: any
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::EC2::NetworkInterfaceAttachment/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ DeviceIndex:
13
+ type: any
14
+ required: yes
15
+ InstanceId:
16
+ type: any
17
+ required: yes
18
+ NetworkInterfaceId:
19
+ type: any
20
+ required: yes
21
+ =:
22
+ type: any
23
+ =:
24
+ type: any
@@ -0,0 +1,71 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::EC2::SecurityGroup/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ GroupDescription:
13
+ type: any
14
+ required: yes
15
+ VpcId:
16
+ type: any
17
+ required: yes
18
+ Tags:
19
+ type: seq
20
+ required: no
21
+ sequence:
22
+ - type: map
23
+ mapping:
24
+ Key:
25
+ type: any
26
+ required: yes
27
+ Value:
28
+ type: any
29
+ required: yes
30
+ =:
31
+ type: any
32
+ # this can be a Hash or an Array... kwalify doesn't seem to have a union concept so defer any such
33
+ # validation into the parser object
34
+ # SecurityGroupIngress:
35
+ # type: seq
36
+ # required: no
37
+ # sequence:
38
+ # - type: map
39
+ # mapping:
40
+ # FromPort:
41
+ # type: any
42
+ # required: yes
43
+ # IpProtocol:
44
+ # type: any
45
+ # required: yes
46
+ # ToPort:
47
+ # type: any
48
+ # required: yes
49
+ # =:
50
+ # type: any
51
+ # SecurityGroupEgress:
52
+ # type: seq
53
+ # required: no
54
+ # sequence:
55
+ # - type: map
56
+ # mapping:
57
+ # FromPort:
58
+ # type: any
59
+ # required: yes
60
+ # IpProtocol:
61
+ # type: any
62
+ # required: yes
63
+ # ToPort:
64
+ # type: any
65
+ # required: yes
66
+ # =:
67
+ # type: any
68
+ =:
69
+ type: any
70
+ =:
71
+ type: any
@@ -0,0 +1,27 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::EC2::SecurityGroupEgress/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ FromPort:
13
+ type: any
14
+ required: yes
15
+ GroupId:
16
+ type: any
17
+ required: yes
18
+ IpProtocol:
19
+ type: any
20
+ required: yes
21
+ ToPort:
22
+ type: any
23
+ required: yes
24
+ =:
25
+ type: any
26
+ =:
27
+ type: any
@@ -0,0 +1,27 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::EC2::SecurityGroupIngress/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ FromPort:
13
+ type: any
14
+ required: yes
15
+ GroupId:
16
+ type: any
17
+ required: yes
18
+ IpProtocol:
19
+ type: any
20
+ required: yes
21
+ ToPort:
22
+ type: any
23
+ required: yes
24
+ =:
25
+ type: any
26
+ =:
27
+ type: any
@@ -0,0 +1,56 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::ElasticLoadBalancingV2::LoadBalancer/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ LoadBalancerAttributes:
13
+ type: seq
14
+ required: no
15
+ sequence:
16
+ - type: map
17
+ mapping:
18
+ Key:
19
+ type: any
20
+ required: yes
21
+ Value:
22
+ type: any
23
+ required: yes
24
+ =:
25
+ type: any
26
+
27
+ # sigh this could be List<AWS::EC2::SecurityGroup::Id> so can't enfore seq
28
+ SecurityGroups:
29
+ type: any
30
+ required: no
31
+
32
+ # sigh this could be List<AWS::EC2::Subnet::Id> so can't enfore seq
33
+ Subnets:
34
+ type: any
35
+ required: yes
36
+
37
+ Tags:
38
+ type: seq
39
+ required: no
40
+ sequence:
41
+ - type: map
42
+ mapping:
43
+ Key:
44
+ type: any
45
+ required: yes
46
+ Value:
47
+ type: any
48
+ required: yes
49
+ =:
50
+ type: any
51
+ =:
52
+ type: any
53
+ =:
54
+ type: any
55
+
56
+
@@ -0,0 +1,188 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::ElasticLoadBalancing::LoadBalancer/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ AccessLoggingPolicy:
13
+ type: map
14
+ required: no
15
+ mapping:
16
+ Enabled:
17
+ type: any
18
+ required: yes
19
+ S3BucketName:
20
+ type: any
21
+ required: yes
22
+ =:
23
+ type: any
24
+ AppCookieStickinessPolicy:
25
+ type: seq
26
+ required: no
27
+ sequence:
28
+ - type: map
29
+ mapping:
30
+ CookieName:
31
+ type: any
32
+ required: yes
33
+ PolicyName:
34
+ type: any
35
+ required: yes
36
+ =:
37
+ type: any
38
+
39
+ # sigh this could be List<AWS::EC2::AvailabilityZone::Name> so can't enfore seq
40
+ AvailabilityZones:
41
+ type: any
42
+ required: no
43
+
44
+ ConnectionDrainingPolicy:
45
+ type: map
46
+ required: no
47
+ mapping:
48
+ Enabled:
49
+ type: any
50
+ required: yes
51
+ Timeout:
52
+ type: any
53
+ required: no
54
+ =:
55
+ type: any
56
+ ConnectionSettings:
57
+ type: map
58
+ required: no
59
+ mapping:
60
+ IdleTimeout:
61
+ type: any
62
+ required: yes
63
+ =:
64
+ type: any
65
+ HealthCheck:
66
+ type: map
67
+ required: no
68
+ mapping:
69
+ HealthyThreshold:
70
+ type: any
71
+ required: yes
72
+ Interval:
73
+ type: any
74
+ required: yes
75
+ Target:
76
+ type: any
77
+ required: yes
78
+ Timeout:
79
+ type: any
80
+ required: yes
81
+ UnhealthyThreshold:
82
+ type: any
83
+ required: yes
84
+ =:
85
+ type: any
86
+
87
+ # sigh this could be List<AWS::EC2::Instance::Id> so can't enfore seq
88
+ Instances:
89
+ type: any
90
+ required: no
91
+
92
+ LBCookieStickinessPolicy:
93
+ type: map
94
+ required: no
95
+ mapping:
96
+ CookieExpirationPeriod:
97
+ type: any
98
+ required: no
99
+ PolicyName:
100
+ type: any
101
+ required: yes
102
+ =:
103
+ type: any
104
+ Listeners:
105
+ type: seq
106
+ required: yes
107
+ sequence:
108
+ - type: map
109
+ mapping:
110
+ InstancePort:
111
+ type: any
112
+ required: yes
113
+ LoadBalancerPort:
114
+ type: any
115
+ required: yes
116
+ PolicyNames:
117
+ type: seq
118
+ required: no
119
+ sequence:
120
+ - type: any
121
+ =:
122
+ type: any
123
+ Policies:
124
+ type: seq
125
+ required: no
126
+ sequence:
127
+ - type: map
128
+ mapping:
129
+ Attributes:
130
+ type: seq
131
+ required: yes
132
+ sequence:
133
+ - type: map
134
+ required: yes
135
+ mapping:
136
+ Name:
137
+ type: any
138
+ required: yes
139
+ Value:
140
+ type: any
141
+ required: yes
142
+ =:
143
+ type: any
144
+ InstancePorts:
145
+ type: seq
146
+ required: no
147
+ sequence:
148
+ - type: any
149
+ LoadBalancerPorts:
150
+ type: seq
151
+ required: no
152
+ sequence:
153
+ - type: any
154
+ PolicyName:
155
+ type: any
156
+ required: yes
157
+ PolicyType:
158
+ type: any
159
+ required: yes
160
+
161
+ # sigh this could be List<AWS::EC2::SecurityGroup::Id> so can't enfore seq
162
+ SecurityGroups:
163
+ type: any
164
+ required: no
165
+
166
+ # sigh this could be List<AWS::EC2::Subnet::Id> so can't enfore seq
167
+ Subnets:
168
+ type: any
169
+ required: no
170
+
171
+ Tags:
172
+ type: seq
173
+ required: no
174
+ sequence:
175
+ - type: map
176
+ mapping:
177
+ Key:
178
+ type: any
179
+ required: yes
180
+ Value:
181
+ type: any
182
+ required: yes
183
+ =:
184
+ type: any
185
+ =:
186
+ type: any
187
+ =:
188
+ type: any
@@ -0,0 +1,23 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ pattern: /AWS::IAM::Group/
7
+ Properties:
8
+ type: map
9
+ mapping:
10
+ ManagedPolicyArns:
11
+ type: seq
12
+ required: no
13
+ sequence:
14
+ - type: any
15
+ Policies:
16
+ type: seq
17
+ required: no
18
+ sequence:
19
+ - type: any
20
+ =:
21
+ type: any
22
+ =:
23
+ type: any
@@ -0,0 +1,34 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::IAM::ManagedPolicy/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ Groups:
13
+ type: seq
14
+ required: no
15
+ sequence:
16
+ - type: any
17
+ Roles:
18
+ type: seq
19
+ required: no
20
+ sequence:
21
+ - type: any
22
+ Users:
23
+ type: seq
24
+ required: no
25
+ sequence:
26
+ - type: any
27
+ PolicyDocument:
28
+ type: any
29
+ required: yes
30
+
31
+ =:
32
+ type: any
33
+ =:
34
+ type: any
@@ -0,0 +1,36 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::IAM::Policy/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ Groups:
13
+ type: seq
14
+ required: no
15
+ sequence:
16
+ - type: any
17
+ Roles:
18
+ type: seq
19
+ required: no
20
+ sequence:
21
+ - type: any
22
+ Users:
23
+ type: seq
24
+ required: no
25
+ sequence:
26
+ - type: any
27
+ PolicyDocument:
28
+ type: any
29
+ required: yes
30
+ PolicyName:
31
+ type: str
32
+ required: yes
33
+ =:
34
+ type: any
35
+ =:
36
+ type: any
@@ -0,0 +1,28 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::IAM::Role/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ ManagedPolicyArns:
13
+ type: seq
14
+ required: no
15
+ sequence:
16
+ - type: any
17
+ Policies:
18
+ type: seq
19
+ required: no
20
+ sequence:
21
+ - type: any
22
+ AssumeRolePolicyDocument:
23
+ type: any
24
+ required: yes
25
+ =:
26
+ type: any
27
+ =:
28
+ type: any
@@ -0,0 +1,38 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::IAM::User/
8
+ Properties:
9
+ type: map
10
+ mapping:
11
+ Groups:
12
+ type: seq
13
+ required: no
14
+ sequence:
15
+ - type: any
16
+ LoginProfile:
17
+ type: map
18
+ required: no
19
+ mapping:
20
+ Password:
21
+ type: any
22
+ required: yes
23
+ =:
24
+ type: any
25
+ ManagedPolicyArns:
26
+ type: seq
27
+ required: no
28
+ sequence:
29
+ - type: any
30
+ Policies:
31
+ type: seq
32
+ required: no
33
+ sequence:
34
+ - type: any
35
+ =:
36
+ type: any
37
+ =:
38
+ type: any
@@ -0,0 +1,23 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::IAM::UserToGroupAddition/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ GroupName:
13
+ type: any
14
+ required: yes
15
+ Users:
16
+ type: seq
17
+ required: yes
18
+ sequence:
19
+ - type: any
20
+ =:
21
+ type: any
22
+ =:
23
+ type: any
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::Lambda::Permission/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ Action:
13
+ type: any
14
+ required: yes
15
+ FunctionName:
16
+ type: any
17
+ required: yes
18
+ Principal:
19
+ type: str
20
+ required: yes
21
+ =:
22
+ type: any
23
+ =:
24
+ type: any
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::S3::BucketPolicy/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ PolicyDocument:
13
+ type: any
14
+ required: yes
15
+ Bucket:
16
+ type: any
17
+ required: yes
18
+ =:
19
+ type: any
20
+ =:
21
+ type: any