Class: Ufo::IamRole::DSL
- Inherits:
-
Object
- Object
- Ufo::IamRole::DSL
- Includes:
- DslEvaluator
- Defined in:
- lib/ufo/iam_role/dsl.rb
Instance Method Summary collapse
- #aws ⇒ Object
- #evaluate ⇒ Object
- #iam_policy(policy_name, statements) ⇒ Object
-
#initialize(path) ⇒ DSL
constructor
A new instance of DSL.
- #managed_iam_policy(*policies) ⇒ Object
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
#aws ⇒ Object
23 24 25 |
# File 'lib/ufo/iam_role/dsl.rb', line 23 def aws AwsData.new end |
#evaluate ⇒ Object
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 |