-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-rds): Unable to use CfnParameter as port #17948
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational DatabasebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
What is the problem?
CfnParameters cannot be used for the port value of a DatabaseInstance in aws-rds. The value requires only a number and valueAsNumber on a CfnParameter doesn't produce a valid number on synthesis.
"Port": "-1.8881545897088186e+289"
instead of
"ToPort": { "Ref": "DBPort" } (as it becomes for a security group)
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseInstance.html
Reproduction Steps
const dbPort = new CfnParameter(this, 'DBPort', {
type: 'Number',
default: 5432
})
const postgresDb = new rds.DatabaseInstance(this, 'PostgresDb', {
port: dbPort.valueAsNumber,
})What did you expect to happen?
Expected that the generated cfn-template would have the port parameter as a reference to the cfn parameter
What actually happened?
The port parameter was set to a static value: -1.8881545897088186e+289
CDK CLI Version
2.0.0 (build 4b6ce31)
Framework Version
No response
Node.js Version
v16.9.1
OS
mac os
Language
Typescript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational DatabasebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1