Class: PracticeTerraforming::Resource::IAMGroupPolicyAttachment
- Inherits:
-
Object
- Object
- PracticeTerraforming::Resource::IAMGroupPolicyAttachment
- Includes:
- Util
- Defined in:
- lib/practice_terraforming/resource/iam_group_policy_attachment.rb
Class Method Summary collapse
-
.tf(client: Aws::IAM::Client.new) ⇒ Object
TODO: Select appropriate Client class from here: docs.aws.amazon.com/sdkforruby/api/index.html.
-
.tfstate(client: Aws::IAM::Client.new) ⇒ Object
TODO: Select appropriate Client class from here: docs.aws.amazon.com/sdkforruby/api/index.html.
Instance Method Summary collapse
-
#initialize(client) ⇒ IAMGroupPolicyAttachment
constructor
A new instance of IAMGroupPolicyAttachment.
- #tf ⇒ Object
- #tfstate ⇒ Object
Methods included from Util
#apply_template, #name_from_tag, #normalize_module_name, #prettify_policy, #template_path
Constructor Details
#initialize(client) ⇒ IAMGroupPolicyAttachment
Returns a new instance of IAMGroupPolicyAttachment.
20 21 22 |
# File 'lib/practice_terraforming/resource/iam_group_policy_attachment.rb', line 20 def initialize(client) @client = client end |
Class Method Details
.tf(client: Aws::IAM::Client.new) ⇒ Object
TODO: Select appropriate Client class from here: docs.aws.amazon.com/sdkforruby/api/index.html
10 11 12 |
# File 'lib/practice_terraforming/resource/iam_group_policy_attachment.rb', line 10 def self.tf(client: Aws::IAM::Client.new) self.new(client).tf end |
.tfstate(client: Aws::IAM::Client.new) ⇒ Object
TODO: Select appropriate Client class from here: docs.aws.amazon.com/sdkforruby/api/index.html
16 17 18 |
# File 'lib/practice_terraforming/resource/iam_group_policy_attachment.rb', line 16 def self.tfstate(client: Aws::IAM::Client.new) self.new(client).tfstate end |
Instance Method Details
#tf ⇒ Object
24 25 26 |
# File 'lib/practice_terraforming/resource/iam_group_policy_attachment.rb', line 24 def tf apply_template(@client, "tf/iam_group_policy_attachment") end |
#tfstate ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/practice_terraforming/resource/iam_group_policy_attachment.rb', line 28 def tfstate .inject({}) do |resources, | attributes = { "id" => [:name], "policy_arn" => [:policy_arn], "group" => [:group] } resources["aws_iam_group_policy_attachment.#{module_name_of()}"] = { "type" => "aws_iam_group_policy_attachment", "primary" => { "id" => [:name], "attributes" => attributes } } resources end end |