google_sql_database resource
Use the google_sql_database
InSpec audit resource to to test a Google Cloud Database resource.
Examples
describe google_sql_database(project: 'chef-gcp-inspec', instance: 'my-database', gcp_db_name: 'my-db') do
it { should exist }
its('name') { should eq 'my-db' }
its('instance') { should eq 'my-database' }
end
Properties
Properties that can be accessed from the google_sql_database
resource:
charset
: The charset value. See MySQL’s Supported Character Sets and Collations and Postgres’ Character Set Support for more details and supported values. Postgres databases only support a value ofUTF8
at creation time.collation
: The collation value. See MySQL’s Supported Character Sets and Collations and Postgres’ Collation Support for more details and supported values. Postgres databases only support a value ofen_US.UTF8
at creation time.name
: The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.instance
: The name of the Cloud SQL instance. This does not include the project ID.
GCP permissions
Ensure the Cloud SQL Admin API is enabled for the current project.