lib/miam/dsl/context/role.rb in miam-0.2.4.beta15 vs lib/miam/dsl/context/role.rb in miam-0.2.4.beta16
- old
+ new
@@ -2,11 +2,11 @@
include Miam::TemplateHelper
def initialize(context, name, &block)
@role_name = name
@context = context.merge(:role_name => name)
- @result = {:instance_profiles => [], :policies => {}, :attached_managed_policies => []}
+ @result = {:instance_profiles => [], :max_session_duration => 3600, :policies => {}, :attached_managed_policies => []}
instance_eval(&block)
end
def result
unless @result[:assume_role_policy_document]
@@ -18,9 +18,13 @@
private
def instance_profiles(*profiles)
@result[:instance_profiles].concat(profiles.map(&:to_s))
+ end
+
+ def max_session_duration(duration)
+ @result[:max_session_duration] = duration
end
def assume_role_policy_document
if @result[:assume_role_policy_document]
raise "Role `#{@role_name}` > AssumeRolePolicyDocument: already defined"