@certenza/aws-cdk-infrastructure-commons 1.0.0 → 1.1.0
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.
- package/dist/src/apigateway.js +10 -0
- package/package.json +1 -1
package/dist/src/apigateway.js
CHANGED
|
@@ -38,6 +38,7 @@ const apigateway = __importStar(require("aws-cdk-lib/aws-apigateway"));
|
|
|
38
38
|
const logs = __importStar(require("aws-cdk-lib/aws-logs"));
|
|
39
39
|
const route53 = __importStar(require("aws-cdk-lib/aws-route53"));
|
|
40
40
|
const route53targets = __importStar(require("aws-cdk-lib/aws-route53-targets"));
|
|
41
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
41
42
|
const acm_1 = require("./acm");
|
|
42
43
|
const route53_1 = require("./route53");
|
|
43
44
|
/**
|
|
@@ -83,6 +84,15 @@ const createApiGateway = (scope, apiName, domainName, hostedZoneId, zoneName) =>
|
|
|
83
84
|
})),
|
|
84
85
|
},
|
|
85
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`, {
|
|
91
|
+
retention: logs.RetentionDays.ONE_MONTH, // Budget-friendly: 1 month retention
|
|
92
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
93
|
+
});
|
|
94
|
+
// Ensure the log group is created after the API
|
|
95
|
+
executionLogGroup.node.addDependency(api);
|
|
86
96
|
// Create Route53 A record pointing to the API Gateway
|
|
87
97
|
new route53.ARecord(scope, `${apiName}-AliasRecord`, {
|
|
88
98
|
zone: hostedZone,
|
package/package.json
CHANGED