Sha256: 1feabf08fe5d52412773ce144d86d1c1a5f6f9f99c35f2a1321be4bcda5a9919

Contents?: true

Size: 615 Bytes

Versions: 102

Compression:

Stored size: 615 Bytes

Contents

module Awspec::Generator
  module Spec
    class Kms
      include Awspec::Helper::Finder
      def generate_all
        aliases = select_all_kms_aliases
        raise 'Not Found alias' if aliases.empty?
        ERB.new(keys_spec_template, nil, '-').result(binding).chomp
      end

      def keys_spec_template
        template = <<-'EOF'
<% aliases.each do |kms_alias| %>
describe kms('<%= kms_alias.alias_name.split('/').last %>') do
  it { should exist }
<% if find_kms_key(kms_alias.target_key_id).enabled -%>
  it { should be_enable }
<% end -%>
end
<% end %>
EOF
        template
      end
    end
  end
end

Version data entries

102 entries across 102 versions & 2 rubygems

Version Path
awspec-1.13.0 lib/awspec/generator/spec/kms.rb
awspec-1.12.7 lib/awspec/generator/spec/kms.rb
awspec-1.12.6 lib/awspec/generator/spec/kms.rb
awspec-1.12.5 lib/awspec/generator/spec/kms.rb
awspec-1.12.4 lib/awspec/generator/spec/kms.rb
awspec-1.12.3 lib/awspec/generator/spec/kms.rb
awspec-1.12.2 lib/awspec/generator/spec/kms.rb
awspec-1.12.1 lib/awspec/generator/spec/kms.rb
awspec-1.12.0 lib/awspec/generator/spec/kms.rb
awspec-1.11.1 lib/awspec/generator/spec/kms.rb
awspec-1.11.0 lib/awspec/generator/spec/kms.rb
awspec-1.10.0 lib/awspec/generator/spec/kms.rb
awspec-1.9.0 lib/awspec/generator/spec/kms.rb
awspec-1.8.0 lib/awspec/generator/spec/kms.rb
awspec-1.7.0 lib/awspec/generator/spec/kms.rb
awspec-1.6.1 lib/awspec/generator/spec/kms.rb
awspec-1.6.0 lib/awspec/generator/spec/kms.rb
awspec-1.5.4 lib/awspec/generator/spec/kms.rb
awspec-1.5.3 lib/awspec/generator/spec/kms.rb
awspec-1.5.2 lib/awspec/generator/spec/kms.rb