title | platform |
---|---|
About the google_kms_crypto_key_iam_binding Resource |
gcp |
Use the google_kms_crypto_key_iam_binding
InSpec audit resource to test properties of a single GCP KMS Crypto Key IAM Binding.
A google_kms_crypto_key_iam_binding
resource block declares the tests for a single KMS Crypto Key IAM Binding for specified role.
describe google_kms_crypto_key_iam_binding(crypto_key_url: 'projects/project/locations/europe-west2/keyRings/key-ring/cryptoKeys/key-name', role: "roles/owner") do
it { should exist }
end
The following examples show how to use this InSpec audit resource.
describe google_kms_crypto_key_iam_binding(crypto_key_url: 'projects/project/locations/europe-west2/keyRings/key-ring/cryptoKeys/key-name', role: "roles/owner") do
it { should exist }
end
describe google_kms_crypto_key_iam_binding(crypto_key_url: 'projects/project/locations/europe-west2/keyRings/key-ring/cryptoKeys/key-name', role: "roles/owner") do
its('members') {should include 'user:someuser@domain.com' }
end
members
Ensure the Cloud Key Management Service (KMS) API is enabled for the project where the resource is located.