Last active
September 4, 2015 17:54
-
-
Save glenjamin/5e518706cc22bb7bb455 to your computer and use it in GitHub Desktop.
Terrafiddle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users = %w( | |
abc | |
def | |
ghi | |
jkl | |
) | |
def autohash | |
Hash.new { |h, k| h[k] = autohash } | |
end | |
resources = autohash | |
resources[:aws_iam_group]["Administrators"] = { | |
name: "Administrators" | |
} | |
resources[:aws_iam_group_membership]["Administrators"] = { | |
name: "Administrators", | |
users: users, | |
group: "${aws_iam_group.Administrators.name}" | |
} | |
users.each do |user| | |
resources[:aws_iam_user][user] = { | |
name: user | |
} | |
end | |
require 'json' | |
puts JSON.pretty_generate({resource: resources}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment