(aws-rds): Unable to use CfnParameter as port
See original GitHub issueWhat 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
class CfnParameter (construct) · AWS CDK
A string that explains a constraint when the constraint is violated. default? any, A value of the appropriate type for the template to...
Read more >Parameters - AWS CloudFormation
Use parameters to pass values to your template when creating or updating a stack so that you can customize each stack deployment.
Read more >Resolve problems connecting to an Amazon RDS DB instance
There are a number of root causes for the inability to connect to an Amazon RDS DB instance. Here are a few of...
Read more >Troubleshoot connectivity to an Amazon RDS instance using ...
My DB instance is in a public subnet, and I can't connect to it over the internet from my local computer. This issue...
Read more >Resolve an Amazon RDS instance that is in an incompatible ...
I can't connect to the DB instance or modify it. ... A DB instance that's scaled to use an instance type that has...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ryparker you want to try and reproduce this one?
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.