A google_kms_key_ring is used to test a Google KeyRing resource
describe google_kms_key_ring(project: 'chef-gcp-inspec', location: 'europe-west2', name: 'kms-key-ring') do
it { should exist }
its('create_time') { should be > Time.now - 365*60*60*24*10 }
its('key_ring_name'){ should eq 'kms-key-ring' }
its('key_ring_url'){ should match 'kms-key-ring' }
end
describe google_kms_key_ring(project: 'chef-gcp-inspec', location: 'europe-west2', name: "nonexistent") do
it { should_not exist }
end
describe google_kms_key_ring(project: 'chef-inspec-gcp', location: 'us-east1', name: 'key-ring-name') do
it { should exist }
end
For any existing key ring, below should definitely be true!
describe google_kms_key_ring(project: 'chef-inspec-gcp', location: 'us-east1', name: 'key-ring-name') do
its('create_time_date') { should be > Time.now - 365*60*60*24*50 }
end
Properties that can be accessed from the google_kms_key_ring resource:
create_timekey_ring_urllocationgcloud kms locations list.Ensure the Cloud Key Management Service (KMS) API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_kms_key_ring/