For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cloudformation-aws-api-gateway-deployment-without-api-gateway-usage-plan-associated.md.
A documentation index is available at /llms.txt.
API Gateway deployments must be associated with a usage plan to enforce throttling and quotas. This mitigates abuse, denial-of-service risks, and unexpected cost spikes from unbounded API traffic.
For each AWS::ApiGateway::Deployment, there must be an AWS::ApiGateway::UsagePlan resource whose Properties.ApiStages array contains an entry with:
ApiId equal to the deployment’s Properties.RestApiId
Stage equal to the deployment’s Properties.StageName
Resources missing a usage plan or with no ApiStages entry matching the deployment’s RestApiId and StageName will be flagged.
Secure configuration example (CloudFormation YAML):