aws-infra-terraform/cloudwatch.tf, with additional logging configuration in api_gateway.tf.
Lambda log groups
Four log groups are explicitly managed in Terraform with a 90-day retention policy:API Gateway log group
The API Gateway has its own log group for access logging:Access log format
API Gateway is configured with detailed structured access logging. Each request produces a JSON log entry containing:
This format makes it straightforward to query access logs in CloudWatch Insights by status code, path, or error message.
Throttling settings
API Gateway throttling limits are configured to protect backend Lambda functions from traffic spikes:
Requests that exceed the rate limit receive a
429 Too Many Requests response.
Querying logs with CloudWatch Insights
You can query any Lambda log group using CloudWatch Insights. Example query to find errors across all Lambda functions:/aws/lambda/parse_invoice) before running the query.