title | platform |
---|---|
About the google_sql_users resource |
gcp |
A google_sql_users
is used to test a Google User resource
describe google_sql_users(project: 'chef-gcp-inspec', database: 'my-database') do
its('user_names') { should include 'user-name' }
end
describe google_sql_users(project: 'chef-inspec-gcp', database: 'database-instance') do
its('count') { should be <= 100}
end
describe google_sql_users(project: 'chef-inspec-gcp') do
its('user_names') { should include "us-east1-b" }
end
describe google_sql_users(project: 'chef-inspec-gcp') do
its('user_statuses') { should_not include "DOWN" }
end
google_sql_database_instances(project: 'chef-inspec-gcp').instance_names.each do |instance_name|
describe google_sql_users(project: 'chef-inspec-gcp', database: instance_name) do
it { should exist }
end
end
Properties that can be accessed from the google_sql_users
resource:
See google_sql_user.md for more detailed information
user_hosts
: an array ofgoogle_sql_user
hostuser_names
: an array ofgoogle_sql_user
nameuser_instances
: an array ofgoogle_sql_user
instancepasswords
: an array ofgoogle_sql_user
password
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 SQL Admin API is enabled for the current project.