turbot/alicloud_thrifty

GitHub
Loading controls...

Control: OSS buckets should have lifecycle policies

Description

Buckets should have a lifecycle policy associated for data retention.

Usage

Run the control in your terminal:

steampipe check alicloud_thrifty.control.oss_bucket_without_lifecycle_policy

Snapshot and share results via Steampipe Cloud:

steampipe login
steampipe check --share 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