Class: Ufo::IamRole::DSL

Inherits:
Object
  • Object
show all
Includes:
DslEvaluator
Defined in:
lib/ufo/iam_role/dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DSL

Returns a new instance of DSL.



5
6
7
# File 'lib/ufo/iam_role/dsl.rb', line 5

def initialize(path)
  @path = path # IE: .ufo/iam_roles/task_role.rb
end

Instance Method Details

#awsObject



23
24
25
# File 'lib/ufo/iam_role/dsl.rb', line 23

def aws
  AwsData.new
end

#evaluateObject



9
10
11
# File 'lib/ufo/iam_role/dsl.rb', line 9

def evaluate
  evaluate_file(@path)
end

#iam_policy(policy_name, statements) ⇒ Object



13
14
15
16
# File 'lib/ufo/iam_role/dsl.rb', line 13

def iam_policy(policy_name, statements)
  role_type = File.basename(@path).sub('.rb','') # task_role or execution_role
  Registry.register_policy(role_type, policy_name, statements)
end

#managed_iam_policy(*policies) ⇒ Object



18
19
20
21
# File 'lib/ufo/iam_role/dsl.rb', line 18

def managed_iam_policy(*policies)
  role_type = File.basename(@path).sub('.rb','') # task_role or execution_role
  Registry.register_managed_policy(role_type, policies)
end