Sha256: 315bb1cafedaf897ba16c6944ca2c8867b09ce79cc80c20ff071d6740521d8a3

Contents?: true

Size: 561 Bytes

Versions: 230

Compression:

Stored size: 561 Bytes

Contents

module Jets::Resource::Iam
  class ManagedPolicy
    extend Memoist

    attr_reader :definitions
    def initialize(*definitions)
      @definitions = definitions.flatten.compact
    end

    def arns
      definitions.map { |definition| standardize(definition) }
    end
    memoize :arns # only process arns once

    # AmazonEC2ReadOnlyAccess => arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess
    def standardize(definition)
      return definition if definition.include?('iam::aws:policy')

      "arn:aws:iam::aws:policy/#{definition}"
    end
  end
end

Version data entries

230 entries across 230 versions & 4 rubygems

Version Path
jets-4.0.12 lib/jets/resource/iam/managed_policy.rb
jets-4.0.11 lib/jets/resource/iam/managed_policy.rb
jets-4.0.10 lib/jets/resource/iam/managed_policy.rb
jets-4.0.9 lib/jets/resource/iam/managed_policy.rb
jets-4.0.8 lib/jets/resource/iam/managed_policy.rb
jets-4.0.7 lib/jets/resource/iam/managed_policy.rb
jets-4.0.6 lib/jets/resource/iam/managed_policy.rb
jets-4.0.5 lib/jets/resource/iam/managed_policy.rb
jets-4.0.4 lib/jets/resource/iam/managed_policy.rb
jets-4.0.3 lib/jets/resource/iam/managed_policy.rb
jets-4.0.2 lib/jets/resource/iam/managed_policy.rb
jets-4.0.1 lib/jets/resource/iam/managed_policy.rb
jets-4.0.0 lib/jets/resource/iam/managed_policy.rb
jets-3.2.2 lib/jets/resource/iam/managed_policy.rb
jets-3.2.1 lib/jets/resource/iam/managed_policy.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/resource/iam/managed_policy.rb
jets-3.2.0 lib/jets/resource/iam/managed_policy.rb
jets-3.1.5 lib/jets/resource/iam/managed_policy.rb
jets-3.1.4 lib/jets/resource/iam/managed_policy.rb
jets-3.1.3 lib/jets/resource/iam/managed_policy.rb