Class: Jets::Cfn::Iam::ManagedPolicy
- Inherits:
-
Object
- Object
- Jets::Cfn::Iam::ManagedPolicy
- Defined in:
- lib/jets/cfn/iam/managed_policy.rb
Overview
Examples: config.codebuild.iam.managed_policies = [AmazonSSMReadOnlyAccess]
Instance Method Summary collapse
-
#initialize(policies) ⇒ ManagedPolicy
constructor
A new instance of ManagedPolicy.
- #standardize ⇒ Object
Constructor Details
#initialize(policies) ⇒ ManagedPolicy
Returns a new instance of ManagedPolicy.
5 6 7 |
# File 'lib/jets/cfn/iam/managed_policy.rb', line 5 def initialize(policies) @policies = policies.compact.flatten.uniq end |
Instance Method Details
#standardize ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jets/cfn/iam/managed_policy.rb', line 9 def standardize return if @policies.nil? || @policies.empty? @policies.map do |policy| if policy.include?("arn:") policy else "arn:aws:iam::aws:policy/#{policy}" end end end |