turbot/terraform_aws_compliance

Query: ec2_instance_termination_protection_enabled

Usage

powerpipe query terraform_aws_compliance.query.ec2_instance_termination_protection_enabled

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'root_block_device' ->> 'delete_on_termination')::bool is true then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'root_block_device' ->> 'delete_on_termination')::bool is true then ' instance termination protection enabled'
else ' instance termination protection disabled'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_instance';

Controls

The query is being used by the following controls: