-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-logsRelated to Amazon CloudWatch LogsRelated to Amazon CloudWatch LogsbugThis issue is a bug.This issue is a bug.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdin-progressThis issue is being actively worked on.This issue is being actively worked on.p2
Description
When using the retention property in logs.LogGroup and provide the value of a parameter, it throws an error that the number is negative: retentionInDays must be positive, got -1.888154589708755e+289. This exception seems to be thrown by the LogGroup.
Here is the CfnParameter:
const retentionInDays = new cdk.CfnParameter(this, "RetentionInDays", { default: 30, type: "Number" });The log group:
new logs.LogGroup(this, "PreAuthLogGroup", {
logGroupName: "/aws/lambda/"+preAuthFunction.functionName,
retention: retentionInDays.valueAsNumber
});Reproduction Steps
- Create a stack with the two resources mentioned above.
- Run
cdk synth.
Error Log
retentionInDays must be positive, got -1.888154589708755e+289
Environment
- CLI Version : 1.27.0
- Framework Version: 1.27.0
- OS : MacOS
- Language : Typescript
Other
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-logsRelated to Amazon CloudWatch LogsRelated to Amazon CloudWatch LogsbugThis issue is a bug.This issue is a bug.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdin-progressThis issue is being actively worked on.This issue is being actively worked on.p2