Class: Convection::Model::Template::Resource::IAMPolicy

Inherits:
Convection::Model::Template::Resource show all
Extended by:
Forwardable
Defined in:
lib/convection/model/template/resource/aws_iam_policy.rb

Overview

AWS::IAM::Policy

Instance Attribute Summary collapse

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, properties, property, #property, #reference, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

#_terraform_module_dir_to_flag, #_terraform_module_flag_to_dir, attach_resource, attach_resource_collection, resource_collection_dsl_methods, resource_dsl_methods

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_import_value, #fn_not, #fn_or, #fn_ref, #fn_sub, #get_att, #get_azs, included, #join, mixers, #select

Constructor Details

#initialize(*args) ⇒ IAMPolicy

Returns a new instance of IAMPolicy.



36
37
38
39
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 36

def initialize(*args)
  super
  @document = Model::Mixin::Policy.new(:template => @template)
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



32
33
34
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 32

def document
  @document
end

Instance Method Details

#groupObject #group(value) ⇒ Object

Overloads:

  • #groupObject

    Returns the value of the ‘Groups’ CloudFormation property.

  • #group(value) ⇒ Object

    Sets the ‘Groups’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘Groups’ CloudFormation property to.



16
17
18
19
20
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 16

property :group, 'Groups', :type => :list,
:transform => (proc do |resource|
  depends_on(resource)
  resource
end)

#policy_nameObject #policy_name(value) ⇒ Object

Overloads:

  • #policy_nameObject

    Returns the value of the ‘PolicyName’ CloudFormation property.

  • #policy_name(value) ⇒ Object

    Sets the ‘PolicyName’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘PolicyName’ CloudFormation property to.



15
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 15

property :policy_name, 'PolicyName'

#renderObject



41
42
43
44
45
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 41

def render
  super.tap do |r|
    document.render(r['Properties'])
  end
end

#roleObject #role(value) ⇒ Object

Overloads:

  • #roleObject

    Returns the value of the ‘Roles’ CloudFormation property.

  • #role(value) ⇒ Object

    Sets the ‘Roles’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘Roles’ CloudFormation property to.



21
22
23
24
25
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 21

property :role, 'Roles', :type => :list,
:transform => (proc do |resource|
  depends_on(resource)
  resource
end)

#userObject #user(value) ⇒ Object

Overloads:

  • #userObject

    Returns the value of the ‘Users’ CloudFormation property.

  • #user(value) ⇒ Object

    Sets the ‘Users’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘Users’ CloudFormation property to.



26
27
28
29
30
# File 'lib/convection/model/template/resource/aws_iam_policy.rb', line 26

property :user, 'Users', :type => :list,
:transform => (proc do |resource|
  depends_on(resource)
  resource
end)