lib/terraforming/resource/rds.rb in terraforming-0.0.5 vs lib/terraforming/resource/rds.rb in terraforming-0.1.0
- old
+ new
@@ -1,27 +1,27 @@
module Terraforming
module Resource
class RDS
include Terraforming::Util
- def self.tf(client = Aws::RDS::Client.new)
+ def self.tf(client: Aws::RDS::Client.new)
self.new(client).tf
end
- def self.tfstate(client = Aws::RDS::Client.new)
- self.new(client).tfstate
+ def self.tfstate(client: Aws::RDS::Client.new, tfstate_base: nil)
+ self.new(client).tfstate(tfstate_base)
end
def initialize(client)
@client = client
end
def tf
apply_template(@client, "tf/rds")
end
- def tfstate
+ def tfstate(tfstate_base)
resources = db_instances.inject({}) do |result, instance|
attributes = {
"address" => instance.endpoint.address,
"allocated_storage" => instance.allocated_storage.to_s,
"availability_zone" => instance.availability_zone,
@@ -57,10 +57,10 @@
}
result
end
- generate_tfstate(resources)
+ generate_tfstate(resources, tfstate_base)
end
private
def db_instances