Sha256: 2e9e3668e87306087e35770366483f2991e0a4f70a9f583a977bbd9fad9095bb

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

module Awspec::Type
  class Kms < Base
    def initialize(id)
      super
      @resource_via_client = find_kms_key_by_alias(id)
      @id = @resource_via_client.arn if @resource_via_client
    end

    def enabled?
      @resource_via_client.enabled
    end

    def has_key_policy?(policy_name, document = nil)
      res = kms_client.get_key_policy(key_id: @id, policy_name: policy_name)
      return JSON.parse(URI.decode(res.policy)) == JSON.parse(document) if document
      res
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awspec-0.55.0 lib/awspec/type/kms.rb
awspec-0.54.0 lib/awspec/type/kms.rb