Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.49 KB

google_kms_key_ring_iam_binding.md

File metadata and controls

50 lines (30 loc) · 1.49 KB
title platform
About the google_kms_key_ring_iam_binding Resource
gcp

google_kms_key_ring_iam_binding

Use the google_kms_key_ring_iam_binding InSpec audit resource to test properties of a single GCP KMS key ring IAM binding.


Syntax

A google_kms_key_ring_iam_binding resource block declares the tests for a single GCP KMS key ring IAM binding by role.

describe google_kms_key_ring_iam_binding(key_ring_url: 'projects/project/locations/europe-west2/keyRings/key-ring', role: 'roles/compute.admin') do
  it { should exist }
  its('members') {should include 'user:someuser@domain.com' }
end

Examples

The following examples show how to use this InSpec audit resource.

Test that a GCP project KMS key ring IAM binding exists

describe google_kms_key_ring_iam_binding(key_ring_url: 'projects/project/locations/europe-west2/keyRings/key-ring', role: 'roles/compute.admin') do
  it { should exist }
end

Test that a GCP project KMS key ring IAM binding has the desired user included

describe google_kms_key_ring_iam_binding(key_ring_url: 'projects/project/locations/europe-west2/keyRings/key-ring', role: 'roles/compute.admin') do
  its('members') {should include 'user:someuser@domain.com' }
end

Properties

  • members

GCP Permissions

Ensure the Cloud Key Management Service (KMS) API is enabled for the project where the resource is located.