Control: EC2 instances termination protection should be enabled
Description
To prevent your instance from being accidentally terminated using Amazon EC2, you can enable termination protection for the instance.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.ec2_instance_termination_protection_enabledSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.ec2_instance_termination_protection_enabled --shareSQL
This control uses a named query:
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_linefrom  terraform_resourcewhere  type = 'aws_instance';