lib/terraforming/resource/network_acl.rb in terraforming-0.1.3 vs lib/terraforming/resource/network_acl.rb in terraforming-0.1.4
- old
+ new
@@ -5,43 +5,41 @@
def self.tf(client: Aws::EC2::Client.new)
self.new(client).tf
end
- def self.tfstate(client: Aws::EC2::Client.new, tfstate_base: nil)
- self.new(client).tfstate(tfstate_base)
+ def self.tfstate(client: Aws::EC2::Client.new)
+ self.new(client).tfstate
end
def initialize(client)
@client = client
end
def tf
apply_template(@client, "tf/network_acl")
end
- def tfstate(tfstate_base)
- resources = network_acls.inject({}) do |result, network_acl|
+ def tfstate
+ network_acls.inject({}) do |resources, network_acl|
attributes = {
"egress.#" => egresses_of(network_acl).length.to_s,
"id" => network_acl.network_acl_id,
"ingress.#" => ingresses_of(network_acl).length.to_s,
"subnet_ids.#" => subnet_ids_of(network_acl).length.to_s,
"tags.#" => network_acl.tags.length.to_s,
"vpc_id" => network_acl.vpc_id,
}
- result["aws_network_acl.#{module_name_of(network_acl)}"] = {
+ resources["aws_network_acl.#{module_name_of(network_acl)}"] = {
"type" => "aws_network_acl",
"primary" => {
"id" => network_acl.network_acl_id,
"attributes" => attributes
}
}
- result
+ resources
end
-
- generate_tfstate(resources, tfstate_base)
end
private
def default_entry?(entry)