question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-rds): Unable to use CfnParameter as port

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
skinny85commented, Dec 10, 2021

@ryparker you want to try and reproduce this one?

0reactions
github-actions[bot]commented, Dec 15, 2021

⚠️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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found