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
cmonson_2ndwatch_awspec-0.85.3 lib/awspec/generator/spec/kms.rb
awspec-0.85.2 lib/awspec/generator/spec/kms.rb
awspec-0.85.1 lib/awspec/generator/spec/kms.rb
awspec-0.85.0 lib/awspec/generator/spec/kms.rb
awspec-0.84.1 lib/awspec/generator/spec/kms.rb
awspec-0.84.0 lib/awspec/generator/spec/kms.rb
awspec-0.83.0 lib/awspec/generator/spec/kms.rb
awspec-0.82.3 lib/awspec/generator/spec/kms.rb
awspec-0.82.2 lib/awspec/generator/spec/kms.rb
awspec-0.82.1 lib/awspec/generator/spec/kms.rb
awspec-0.82.0 lib/awspec/generator/spec/kms.rb
awspec-0.81.1 lib/awspec/generator/spec/kms.rb
awspec-0.81.0 lib/awspec/generator/spec/kms.rb
awspec-0.80.1 lib/awspec/generator/spec/kms.rb
awspec-0.80.0 lib/awspec/generator/spec/kms.rb
awspec-0.79.2 lib/awspec/generator/spec/kms.rb
awspec-0.79.1 lib/awspec/generator/spec/kms.rb
awspec-0.79.0 lib/awspec/generator/spec/kms.rb
awspec-0.78.1 lib/awspec/generator/spec/kms.rb
awspec-0.77.1 lib/awspec/generator/spec/kms.rb