Sha256: d84e9f0ae24a171355d8fc0d04f9e5f94d5b15d7b01aa8e7c4da6cf26586e57f

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

require_relative '../resource'

module Convection
  module DSL
    ## Add DSL method to template namespace
    module Template
      def iam_role(name, &block)
        r = Model::Template::Resource::IAMRole.new(name, self)
        r.instance_exec(&block) if block

        resources[name] = r
      end
    end
  end

  module Model
    class Template
      class Resource
        ##
        # AWS::IAM::Role
        ##
        class IAMRole < Resource
          def initialize(*args)
            super

            type 'AWS::IAM::Role'
            @properties['Policies'] = []
          end

          def path(value)
            property('Path', value)
          end

          def policies(value)
            @properties['Policies'] << value
          end

          def assume_role_policy_document(value)
            property('AssumeRolePolicyDocument', value)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
convection-0.0.1 lib/convection/model/template/resource/aws_iam_role.rb