turbot/aws_insights

Query: cloudfront_distributions_for_acm_certificate

Usage

powerpipe query aws_insights.query.cloudfront_distributions_for_acm_certificate

SQL

with certificate_usage as (
select
jsonb_array_elements_text(in_use_by) as in_use_arn
from
aws_acm_certificate
where
account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
and certificate_arn = $1
)
select
d.arn as distribution_arn
from
aws_cloudfront_distribution d
join
certificate_usage cu on d.arn = cu.in_use_arn;