title | platform |
---|---|
About the google_kms_key_rings resource |
gcp |
A google_kms_key_rings
is used to test a Google KeyRing resource
describe google_kms_key_rings(project: 'chef-gcp-inspec', location: 'europe-west2') do
its('key_ring_names'){ should include 'kms-key-ring' }
end
describe.one do
google_kms_key_rings(project: 'chef-gcp-inspec', location: 'europe-west2').key_ring_urls do |url|
describe url do
it { should match 'kms-key-ring' }
end
end
end
describe google_kms_key_rings(project: 'chef-inspec-gcp', location: 'us-east1') do
its('count') { should be <= 200}
end
describe google_kms_key_rings(project: 'chef-inspec-gcp', location: 'us-east1') do
its('key_ring_names') { should include "a-named-key" }
end
describe google_kms_key_rings(project: gcp_project_id, location: 'us-east1').key_ring_names.each do |key_ring_name|
describe google_kms_key_ring(project: 'chef-inspec-gcp', location: 'us-east1', 'name: key_ring_name) do
it { should exist }
its('create_time_date') { should be > Time.now - 365*60*60*24 }
end
end
Properties that can be accessed from the google_kms_key_rings
resource:
See google_kms_key_ring.md for more detailed information
create_times
: an array ofgoogle_kms_key_ring
create_timekey_ring_urls
: an array ofgoogle_kms_key_ring
key_ring_urllocations
: an array ofgoogle_kms_key_ring
location
This resource supports all of the above properties as filter criteria, which can be used
with where
as a block or a method.
Ensure the Cloud Key Management Service (KMS) API is enabled for the current project.