-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Unable to use CfnParameter valueAsNumber in SQS Queue #7126
Copy link
Copy link
Closed
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionalitybugThis issue is a bug.This issue is a bug.in-progressThis issue is being actively worked on.This issue is being actively worked on.p1
Description
If trying to use a CfnParameter with a SQS Queue you end up with the following error:
message retention period must be 60 seconds or more, but -1.8881545897087585e+289 was provided
Reproduction Steps
const redemptionPeriod = new CfnParameter(this, 'RedendtionPeriod', {
description: 'SQS redention period in seconds 60 - 1209600 [14400]',
type: 'Number',
default: 14400,
minValue: 60,
maxValue: 1209600,
constraintDescription: 'Must be between 60 and 1209600',
});
return new Queue(this, 'Queue', {
queueName: 'queue',
retentionPeriod: Duration.seconds(redemptionPeriod.valueAsNumber), // This pass typechecking but will at best fail and at worst pass with the incorrect number.
deliveryDelay: Duration.seconds(0),
maxMessageSizeBytes: 1024,
receiveMessageWaitTime: Duration.seconds(20),
visibilityTimeout: Duration.seconds(60),
});Error Log
message retention period must be 60 seconds or more, but -1.8881545897087585e+289 was provided
Environment
- **CLI Version :1.31.0
- **Framework Version:1.31.0
- **OS :MacOS
- **Language :Typescript
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionalitybugThis issue is a bug.This issue is a bug.in-progressThis issue is being actively worked on.This issue is being actively worked on.p1