A google_service_account_key is used to test a Google ServiceAccountKey resource
google_service_account_keys(project: 'chef-gcp-inspec', service_account: "[email protected]").key_names.each do |sa_key_name|
describe google_service_account_key(project: 'chef-gcp-inspec', service_account: "[email protected]", name: sa_key_name.split('/').last) do
it { should exist }
its('key_type') { should_not cmp 'USER_MANAGED' }
end
end
describe google_service_account_key(name: "projects/sample-project/serviceAccounts/[email protected]/keys/c6bd986da9fac6d71178db41d1741cbe751a5080" ) do
its('key_algorithm') { should eq "KEY_ALG_RSA_2048" }
end
Properties that can be accessed from the google_service_account_key resource:
nameprivate_key_typePossible values:
key_algorithmPossible values:
private_key_datapublic_key_datavalid_after_timevalid_before_timekey_typePossible values:
service_accountpathEnsure the Identity and Access Management (IAM) 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_service_account_key/