Class: Pipedream::Role
- Inherits:
-
Object
- Object
- Pipedream::Role
- Defined in:
- lib/pipedream/role.rb
Constant Summary
Constants included from Dsl::Role
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Role
constructor
A new instance of Role.
- #logical_id ⇒ Object
- #run ⇒ Object
Methods included from Evaluate
Methods included from Dsl::Role
#iam_policy, #managed_iam_policy, #standardize_iam_policy, #standardize_managed_iam_policy
Constructor Details
#initialize(options = {}) ⇒ Role
Returns a new instance of Role.
8 9 10 11 12 |
# File 'lib/pipedream/role.rb', line 8 def initialize(={}) @options = @role_path = [:role_path] || get_role_path @properties = default_properties end |
Instance Method Details
#logical_id ⇒ Object
35 36 37 |
# File 'lib/pipedream/role.rb', line 35 def logical_id "IamRole" end |
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pipedream/role.rb', line 14 def run evaluate(@role_path) if File.exist?(@role_path) @properties[:policies] = [{ policy_name: "CodePipelineAccess", policy_document: { version: "2012-10-17", statement: derived_iam_statements } }] @properties[:managed_policy_arns] = @managed_policy_arns if @managed_policy_arns && !@managed_policy_arns.empty? resource = { logical_id => { type: "AWS::IAM::Role", properties: @properties } } CfnCamelizer.transform(resource) end |