Class: Miam::DSL::Context::Role

Inherits:
Object
  • Object
show all
Includes:
TemplateHelper
Defined in:
lib/miam/dsl/context/role.rb

Instance Method Summary collapse

Methods included from TemplateHelper

#context, #include_template

Constructor Details

#initialize(context, name, &block) ⇒ Role

Returns a new instance of Role.



4
5
6
7
8
9
# File 'lib/miam/dsl/context/role.rb', line 4

def initialize(context, name, &block)
  @role_name = name
  @context = context.merge(:role_name => name)
  @result = {:instance_profiles => [], :max_session_duration => 3600, :policies => {}, :attached_managed_policies => []}
  instance_eval(&block)
end

Instance Method Details

#resultObject



11
12
13
14
15
16
17
# File 'lib/miam/dsl/context/role.rb', line 11

def result
  unless @result[:assume_role_policy_document]
    raise "Role `#{@role_name}`: AssumeRolePolicyDocument is not defined"
  end

  @result
end