@certenza/aws-cdk-infrastructure-commons 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,15 +84,16 @@ const createApiGateway = (scope, apiName, domainName, hostedZoneId, zoneName) =>
84
84
  })),
85
85
  },
86
86
  });
87
- // Create execution log group with 1-month retention
88
- // We need to create this log group explicitly to set retention
89
- // The log group name uses tokens that will be resolved at deployment time
90
- const executionLogGroup = new logs.LogGroup(scope, `${apiName}-ExecutionLogs`, {
87
+ // Set retention for execution log group that API Gateway creates automatically
88
+ // API Gateway creates execution logs in the format: API-Gateway-Execution-Logs_{api-id}/{stage-name}
89
+ // We use LogRetention to set the retention policy after API Gateway creates the log group
90
+ new logs.LogRetention(scope, `${apiName}-ExecutionLogRetention`, {
91
+ logGroupName: cdk.Token.asString(cdk.Fn.join("/", [
92
+ cdk.Fn.join("_", ["API-Gateway-Execution-Logs", api.restApiId]),
93
+ api.deploymentStage.stageName,
94
+ ])),
91
95
  retention: logs.RetentionDays.ONE_MONTH, // Budget-friendly: 1 month retention
92
- removalPolicy: cdk.RemovalPolicy.DESTROY,
93
96
  });
94
- // Ensure the log group is created after the API
95
- executionLogGroup.node.addDependency(api);
96
97
  // Create Route53 A record pointing to the API Gateway
97
98
  new route53.ARecord(scope, `${apiName}-AliasRecord`, {
98
99
  zone: hostedZone,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certenza/aws-cdk-infrastructure-commons",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Common infrastructure reusable utilities and resources for Certenza projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",