turbot/aws_insights

Query: s3_bucket_cross_region_replication_status

Usage

powerpipe query aws_insights.query.s3_bucket_cross_region_replication_status

Steampipe Tables

SQL

with bucket_with_replication as (
select
name,
r ->> 'Status' as rep_status
from
aws_s3_bucket,
jsonb_array_elements(replication -> 'Rules' ) as r
), tets as (
select
case
when b.name = r.name and r.rep_status = 'Enabled' then 'enabled' else 'disabled'
end as visibility
from
aws_s3_bucket b
left join bucket_with_replication r on b.name = r.name
)
select
visibility,
count(*)
from
tets
group by
visibility;

Dashboards

The query is used in the dashboards: