lib/terraforming/resource/route53_zone.rb in terraforming-0.1.3 vs lib/terraforming/resource/route53_zone.rb in terraforming-0.1.4

- old
+ new

@@ -5,44 +5,42 @@ def self.tf(client: Aws::Route53::Client.new) self.new(client).tf end - def self.tfstate(client: Aws::Route53::Client.new, tfstate_base: nil) - self.new(client).tfstate(tfstate_base) + def self.tfstate(client: Aws::Route53::Client.new) + self.new(client).tfstate end def initialize(client) @client = client end def tf apply_template(@client, "tf/route53_zone") end - def tfstate(tfstate_base) - resources = hosted_zones.inject({}) do |result, hosted_zone| + def tfstate + hosted_zones.inject({}) do |resources, hosted_zone| zone_id = zone_id_of(hosted_zone) attributes = { "id"=> zone_id, "name"=> name_of(hosted_zone), "name_servers.#" => name_servers_of(hosted_zone).length.to_s, "tags.#" => tags_of(hosted_zone).length.to_s, "zone_id" => zone_id, } - result["aws_route53_zone.#{module_name_of(hosted_zone)}"] = { + resources["aws_route53_zone.#{module_name_of(hosted_zone)}"] = { "type" => "aws_route53_zone", "primary" => { "id" => zone_id, "attributes" => attributes, } } - result + resources end - - generate_tfstate(resources, tfstate_base) end private def hosted_zones