turbot/terraform_gcp_compliance

Query: sql_instance_automated_backups_enabled

Usage

powerpipe query terraform_gcp_compliance.query.sql_instance_automated_backups_enabled

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'settings' -> 'backup_configuration' ->> 'enabled')::boolean then 'ok' else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'settings') is null then ' ''settings'' is not defined'
when (attributes_std -> 'settings' -> 'backup_configuration') is null then ' ''settings.backup_configuration'' is not defined'
when (attributes_std -> 'settings' -> 'backup_configuration' ->> 'enabled') is null
then ' ''settings.backup_configuration.enabled'' is not defined'
when (attributes_std -> 'settings' -> 'backup_configuration' ->> 'enabled')::boolean then ' automatic backups configured'
else ' automatic backups not configured'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_sql_database_instance';

Controls

The query is being used by the following controls: