turbot/terraform_gcp_compliance

Query: logging_bucket_retention_policy_enabled

Usage

powerpipe query terraform_gcp_compliance.query.logging_bucket_retention_policy_enabled

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'retention_policy' ->> 'is_locked')::boolean then 'ok' else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'retention_policy') is null then ' ''retention_policy'' is not defined'
when (attributes_std -> 'retention_policy' ->> 'is_locked') is null then ' ''retention_policy.is_locked'' is not defined'
when (attributes_std -> 'retention_policy' ->> 'is_locked')::boolean then ' has retention policies configured'
else ' does not have retention policies configured.'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_storage_bucket';

Controls

The query is being used by the following controls: