turbot/alicloud_thrifty

Control: OSS buckets should have lifecycle policies

Description

Buckets should have a lifecycle policy associated for data retention.

Usage

steampipe check alicloud_thrifty.control.oss_bucket_without_lifecycle_policy

Plugins & Tables

SQL

select
arn as resource,
case
when lifecycle_rules is null then 'alarm'
when lifecycle_rules @> '[{"Status":"Enabled"}]' then 'ok'
else 'alarm'
end as status,
case
when lifecycle_rules is null then title || ' has no lifecycle policy.'
when lifecycle_rules @> '[{"Status":"Enabled"}]' then title || ' has lifecycle policy.'
else title || ' has disabled lifecycle policy.'
end as reason,
region,
account_id
from
alicloud_oss_bucket;

Tags