lib/terraforming/resource/iam_user.rb in terraforming-0.1.3 vs lib/terraforming/resource/iam_user.rb in terraforming-0.1.4
- old
+ new
@@ -5,42 +5,40 @@
def self.tf(client: Aws::IAM::Client.new)
self.new(client).tf
end
- def self.tfstate(client: Aws::IAM::Client.new, tfstate_base: nil)
- self.new(client).tfstate(tfstate_base)
+ def self.tfstate(client: Aws::IAM::Client.new)
+ self.new(client).tfstate
end
def initialize(client)
@client = client
end
def tf
apply_template(@client, "tf/iam_user")
end
- def tfstate(tfstate_base)
- resources = iam_users.inject({}) do |result, user|
+ def tfstate
+ iam_users.inject({}) do |resources, user|
attributes = {
"arn"=> user.arn,
"id" => user.user_name,
"name" => user.user_name,
"path" => user.path,
"unique_id" => user.user_id,
}
- result["aws_iam_user.#{user.user_name}"] = {
+ resources["aws_iam_user.#{user.user_name}"] = {
"type" => "aws_iam_user",
"primary" => {
"id" => user.user_name,
"attributes" => attributes
}
}
- result
+ resources
end
-
- generate_tfstate(resources, tfstate_base)
end
private
def iam_users