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.

.NET CDK 1.8 ClusterEndpoint does not return port number

See original GitHub issue

Like with #2711, .NET CDK 1.8 DatabaseCluster.ClusterEndpoint.Port is of type double, precluding getting endpoint port back. The workaround described in #2711 can be used to mitigate the issue.

Reproduction Steps

Use .NET CDK 1.8 to create RDS Aurora cluster.

https://github.com/vgribok/modernization-unicorn-store/blob/073bc28f19108f86e53f7138e5544dee9f36492f/infra-as-code/src/Reusable/DatabaseConstructFactory.cs#L84

Error Log

Environment

  • CLI Version :1.8
  • Framework Version: .NET Core 2.1
  • OS :WIndows 10
  • Language :.NET C#

Other

#2711


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marioizquierdocommented, Dec 15, 2020

In case anyone else ends up in this question, the mystery number comes form the numeric Token representation: https://docs.aws.amazon.com/cdk/latest/guide/tokens.html

To solve this in my case, I used the cdk.Token class to convert the numeric Token into a string Token:

environment: {
    DB_PORT: cdk.Token.asString(props.rdsICluster.clusterReadEndpoint.port),
},

This synthesizes as "Fn::ImportValue": "FoobarInfra:ExportsOutputFnGetAttDatabaseB269D8BBEndpointPort3ACB3F51", which ends with the correct value in the ECS Task Container.

0reactions
vgribokcommented, Dec 15, 2020

It’s a nice workaround, @marioizquierdo, thank you, but it also shows the problem is still there and the issue needs trip be reopened @RomainMuller.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class DatabaseCluster (construct) · AWS CDK
You are not viewing the latest version. ... Create a clustered database with a given number of instances. ... port? number, What port...
Read more >
aws-cdk.aws-ec2 - PyPI
The CDK Construct Library for AWS::EC2. ... PRIVATE_WITH_NAT ) - instances in private subnets are not directly routable from the Internet, and connect...
Read more >
How to use the @aws-cdk/core.Output function in ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix ... public export(): DatabaseClusterRefProps { return {...
Read more >
How to upgrade CDK from CDKv1 to CDKv2 in an existing ...
txt is used. The data platform itself is created in a so-called restricted AWS environment, which means that there is no public internet...
Read more >
Redshift Cluster Default Port | Trend Micro
To change your Redshift database cluster endpoint port follow the steps outlined in the Remediation/Resolution section. 06 Repeat step no. 4 and ...
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