turbot/steampipe-mod-terraform-aws-compliance

Control: API Gateway Deployment should have create_before_destroy enabled

Description

This control checks whether AWS API Gateway Deployment has create_before_destroy enabled. It is recommended to enable the resource lifecycle configuration block create_before_destroy argument in this resource configuration to manage all requests that use this API, avoiding an outage.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.apigateway_deployment_create_before_destroy_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.apigateway_deployment_create_before_destroy_enabled --share

SQL

This control uses a named query:

select
address as resource,
case
when (lifecycle ->> 'create_before_destroy') = 'true' then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (lifecycle ->> 'create_before_destroy') = 'true' then ' create before destroy enabled'
else ' create before destroy disabled'
end || '.' reason
from
terraform_resource
where
type = 'aws_api_gateway_deployment';

Tags