From 0ec1e0d1b342413b650dbebe76ca45383a7d4edd Mon Sep 17 00:00:00 2001 From: Erran Carey Date: Mon, 6 Jun 2016 11:38:15 +0100 Subject: [PATCH] Fix #129 - Add an assume_role_policy DSL method to iam_role --- lib/convection/model/template/resource/aws_iam_role.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/convection/model/template/resource/aws_iam_role.rb b/lib/convection/model/template/resource/aws_iam_role.rb index b76974f..e1fdeec 100644 --- a/lib/convection/model/template/resource/aws_iam_role.rb +++ b/lib/convection/model/template/resource/aws_iam_role.rb @@ -6,6 +6,11 @@ module Template module Resource ## Role DSL module IAMRole + def assume_role_policy(policy_name, &block) + @trust_relationship = Model::Mixin::Policy.new(:name => policy_name, :template => @template) + trust_relationship.instance_exec(&block) if block + end + def policy(policy_name, &block) add_policy = Model::Mixin::Policy.new(:name => policy_name, :template => @template) add_policy.instance_exec(&block) if block