cfn-model 0.4.27 → 0.4.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfn-model/model/ec2_network_acl.rb +3 -5
- data/lib/cfn-model/model/ec2_network_acl_entry.rb +10 -0
- data/lib/cfn-model/parser/ec2_network_acl_parser.rb +7 -29
- data/lib/cfn-model/schema/AWS_EC2_NetworkAcl.yml +15 -0
- data/lib/cfn-model/schema/AWS_EC2_NetworkAclEntry.yml +21 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1ac14db4c825a752953a999fca09e56eaaa3e7141146bea1892cfe0c1f350c
|
4
|
+
data.tar.gz: 010c17ccd4d19b1999768d8b41b71dd98f6cca02713cf3065ac6cf208ee4d4f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2530d80cc408f921c69ec5757c6b4c73a064a1d6e7c980cce9dd3a0441bdd501e82685ceff915c756ea7a4cd4fd52f712ddb7cd63a190686abc9b8613b63de05
|
7
|
+
data.tar.gz: 8f053b02001d51fb7f4130e6b77d0e9cc7d3c36f35d8e3b9c3d55b6d9cc610a9ab02cdb8604c4385556819aa4e7581f2bf23cd912b910220b0f7c7bfd13d8dd6
|
@@ -3,13 +3,11 @@
|
|
3
3
|
require_relative 'model_element'
|
4
4
|
|
5
5
|
class AWS::EC2::NetworkAcl < ModelElement
|
6
|
-
attr_accessor :
|
7
|
-
attr_accessor :network_acl_ingress_entries
|
6
|
+
attr_accessor :network_acl_entries
|
8
7
|
|
9
8
|
def initialize(cfn_model)
|
10
9
|
super
|
11
|
-
@
|
12
|
-
@network_acl_ingress_entries = []
|
10
|
+
@network_acl_entries = []
|
13
11
|
@resource_type = 'AWS::EC2::NetworkAcl'
|
14
12
|
end
|
15
|
-
end
|
13
|
+
end
|
@@ -8,45 +8,23 @@ require 'cfn-model/util/truthy'
|
|
8
8
|
class Ec2NetworkAclParser
|
9
9
|
def parse(cfn_model:, resource:)
|
10
10
|
network_acl = resource
|
11
|
-
|
12
11
|
attach_nacl_entries_to_nacl(cfn_model: cfn_model, network_acl: network_acl)
|
13
12
|
network_acl
|
14
13
|
end
|
15
14
|
|
16
15
|
private
|
17
16
|
|
18
|
-
def
|
19
|
-
network_acl_entries = cfn_model.resources_by_type
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
def ingress_network_acl_entries(cfn_model)
|
24
|
-
network_acl_entries = cfn_model.resources_by_type 'AWS::EC2::NetworkAclEntry'
|
25
|
-
network_acl_entries.select do |network_acl_entry|
|
26
|
-
not_truthy?(network_acl_entry.egress)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def egress_nacl_entries_for_nacl(cfn_model, logical_resource_id)
|
31
|
-
egress_nacl_entries = egress_network_acl_entries(cfn_model)
|
32
|
-
egress_nacl_entries.select do |egress_nacl_entry|
|
33
|
-
References.resolve_resource_id(egress_nacl_entry.networkAclId) == logical_resource_id
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def ingress_nacl_entries_for_nacl(cfn_model, logical_resource_id)
|
38
|
-
ingress_nacl_entries = ingress_network_acl_entries(cfn_model)
|
39
|
-
ingress_nacl_entries.select do |ingress_nacl_entry|
|
40
|
-
References.resolve_resource_id(ingress_nacl_entry.networkAclId) == logical_resource_id
|
17
|
+
def nacl_entries_for_nacl(cfn_model, logical_resource_id)
|
18
|
+
network_acl_entries = cfn_model.resources_by_type('AWS::EC2::NetworkAclEntry')
|
19
|
+
.select do |network_acl_entry|
|
20
|
+
References.resolve_resource_id(network_acl_entry.networkAclId) == logical_resource_id
|
41
21
|
end
|
22
|
+
network_acl_entries
|
42
23
|
end
|
43
24
|
|
44
25
|
def attach_nacl_entries_for_nacl(cfn_model, network_acl)
|
45
|
-
|
46
|
-
network_acl.
|
47
|
-
end
|
48
|
-
ingress_nacl_entries_for_nacl(cfn_model, network_acl.logical_resource_id).each do |ingress_entry|
|
49
|
-
network_acl.network_acl_ingress_entries << ingress_entry.logical_resource_id
|
26
|
+
nacl_entries_for_nacl(cfn_model, network_acl.logical_resource_id).each do |network_acl_entry|
|
27
|
+
network_acl.network_acl_entries << network_acl_entry
|
50
28
|
end
|
51
29
|
end
|
52
30
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
type: map
|
3
|
+
mapping:
|
4
|
+
Type:
|
5
|
+
type: str
|
6
|
+
required: yes
|
7
|
+
pattern: /AWS::EC2::NetworkAclEntry/
|
8
|
+
Properties:
|
9
|
+
type: map
|
10
|
+
required: yes
|
11
|
+
mapping:
|
12
|
+
Icmp:
|
13
|
+
type: any
|
14
|
+
required: no
|
15
|
+
PortRange:
|
16
|
+
type: any
|
17
|
+
required: no
|
18
|
+
=:
|
19
|
+
type: any
|
20
|
+
=:
|
21
|
+
type: any
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/cfn-model/model/cfn_model.rb
|
68
68
|
- lib/cfn-model/model/ec2_instance.rb
|
69
69
|
- lib/cfn-model/model/ec2_network_acl.rb
|
70
|
+
- lib/cfn-model/model/ec2_network_acl_entry.rb
|
70
71
|
- lib/cfn-model/model/ec2_network_interface.rb
|
71
72
|
- lib/cfn-model/model/iam_group.rb
|
72
73
|
- lib/cfn-model/model/iam_managed_policy.rb
|
@@ -115,6 +116,8 @@ files:
|
|
115
116
|
- lib/cfn-model/psych/visitors/to_ruby_with_line_numbers.rb
|
116
117
|
- lib/cfn-model/schema/AWS_CloudFront_Distribution.yml
|
117
118
|
- lib/cfn-model/schema/AWS_EC2_Instance.yml
|
119
|
+
- lib/cfn-model/schema/AWS_EC2_NetworkAcl.yml
|
120
|
+
- lib/cfn-model/schema/AWS_EC2_NetworkAclEntry.yml
|
118
121
|
- lib/cfn-model/schema/AWS_EC2_NetworkInterface.yml
|
119
122
|
- lib/cfn-model/schema/AWS_EC2_NetworkInterfaceAttachment.yml
|
120
123
|
- lib/cfn-model/schema/AWS_EC2_SecurityGroup.yml
|