lib/terraforming/resource/eip.rb in terraforming-0.12.0 vs lib/terraforming/resource/eip.rb in terraforming-0.13.0

- old
+ new

@@ -30,11 +30,11 @@ "private_ip" => addr.private_ip_address, "public_ip" => addr.public_ip, "vpc" => vpc?(addr).to_s, } attributes.delete_if { |_k, v| v.nil? } - resources["aws_eip.#{addr.allocation_id}"] = { + resources["aws_eip.#{module_name_of(addr)}"] = { "type" => "aws_eip", "primary" => { "id" => addr.allocation_id, "attributes" => attributes } @@ -50,9 +50,13 @@ @client.describe_addresses.map(&:addresses).flatten end def vpc?(addr) addr.domain.eql?("vpc") + end + + def module_name_of(addr) + normalize_module_name(addr.allocation_id) end end end end