Set 30-day retention on API Gateway access log group - #1355
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32307d77e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ApiGatewayAccessLogGroup: | ||
| Type: AWS::Logs::LogGroup | ||
| Properties: | ||
| LogGroupName: /aws/api-gateway/${self:service}-${sls:stage} | ||
| RetentionInDays: 30 |
There was a problem hiding this comment.
Remove duplicate API Gateway access log group resource
Defining ApiGatewayAccessLogGroup here creates a second AWS::Logs::LogGroup with the same name that Serverless already generates when provider.logs.restApi.accessLogging is enabled (/aws/api-gateway/${service}-${stage}), so CloudFormation can fail updates with a “resource already exists”/name conflict during deploy. In this config, provider.logs.restApi.accessLogging is on, so this extra resource is not just redundant—it is deploy-blocking for stack updates.
Useful? React with 👍 / 👎.
Codifies the 30-day retention policy already applied via CLI to
/aws/api-gateway/fourtiesnyc-production, so it survives stack redeployments.🤖 Generated with Claude Code