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-method-does-not-contain-an-api-key.md.
A documentation index is available at /llms.txt.
API Gateway methods must require an API key to prevent unauthenticated or uncontrolled usage that can lead to abuse, unexpected costs, or bypassing usage plans. For CloudFormation, AWS::ApiGateway::Method resources must define Properties.ApiKeyRequired and set it to true. Resources missing ApiKeyRequired or with ApiKeyRequired set to false will be flagged. Note that API keys help enforce usage plans and quotas but are not a substitute for strong authentication or authorization.