lib/terraforming/resource/network_acl.rb in terraforming-0.0.2 vs lib/terraforming/resource/network_acl.rb in terraforming-0.0.3
- old
+ new
@@ -42,20 +42,28 @@
generate_tfstate(resources)
end
private
+ def default_entry?(entry)
+ entry.rule_number == default_rule_number
+ end
+
+ def default_rule_number
+ 32767
+ end
+
def egresses_of(network_acl)
- network_acl.entries.select { |entry| entry.egress }
+ network_acl.entries.select { |entry| entry.egress && !default_entry?(entry) }
end
def from_port_of(entry)
entry.port_range ? entry.port_range.from : 0
end
def ingresses_of(network_acl)
- network_acl.entries.select { |entry| !entry.egress }
+ network_acl.entries.select { |entry| !entry.egress && !default_entry?(entry) }
end
def module_name_of(network_acl)
normalize_module_name(name_from_tag(network_acl, network_acl.network_acl_id))
end
@@ -63,10 +71,10 @@
def network_acls
@client.describe_network_acls.network_acls
end
def to_port_of(entry)
- entry.port_range ? entry.port_range.to : 65535
+ entry.port_range ? entry.port_range.to : 0
end
end
end
end