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.

RDS - Isolated subnet

See original GitHub issue

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.

  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

Error adding RDS instance to Isolated subnet from imported VPC.

Error: There are no 'Isolated' subnets in this VPC. Use a different VPC subnet selection.
    const vpc = ec2.Vpc.fromLookup(this, "lookupVPC", {
      vpcName: "MyVPC"
    });

    const dbInstance = new rds.DatabaseInstance(this, "Instance", {
      engine: rds.DatabaseInstanceEngine.POSTGRES,
      instanceClass: new ec2.InstanceType("t3.micro"),
      masterUsername: dbInstanceUser,
      vpcPlacement: {
        subnetType: ec2.SubnetType.ISOLATED
      },
      vpc
    });

The VPC does contain an isolated subnet (it was created in another cdk stack). I suspect the problem is here:

https://github.com/aws/aws-cdk/blob/v1.0.0/packages/@aws-cdk/aws-ec2/lib/vpc.ts#L1355

as it doesn’t contain a dummy entry for isolated subnets.

  • What is the expected behavior (or behavior of feature suggested)?

No error. Construct created.

  • What is the motivation / use case for changing the behavior or adding this feature?

  • Please tell us about your environment:

    • CDK CLI Version: 00.37.00
    • Module Version: 00.37.00
    • OS: [all | Windows 10 | OSX Mojave | Ubuntu | etc… ]
    • Language: [all | TypeScript | Java | Python ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mmccauley-verimatrixcommented, Feb 26, 2020

I encountered this issue for both RDS Aurora & Lambdas and was able to work around it by changing from

vpc_subnets=aws_ec2.SubnetType.ISOLATED

To

vpc_subnets=aws_ec2.SubnetSelection(subnet_group_name="data")
1reaction
michaeldimoudiscommented, Oct 22, 2019

@skinny85 I have the exact same issue. I solved it by accident, but really it’s not ideal.

Doing cdk diff with the rds vpcPlacement set to ISOLATED spat out that error, and there was nothing in cdk.context.json.

Changed the rds vpcPlacement set to PRIVATE, did a cdk diff, it worked and the cdk.context.json populated, with correct isolated subnets in there.

I then changed rds vpcPlacement back to ISOLATED, and this time it worked and got deployed out successfully…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with a DB instance in a VPC - AWS Documentation
When you create a DB instance in a VPC, you can choose a DB subnet group. Amazon RDS chooses a subnet and an...
Read more >
Use AWS CDK to Create an RDS Instance in an ISOLATED ...
I'm trying to use CDK (Typescript) to create an RDS (Postgres) instance within an ISOLATED subnet. As far as I understood, the default...
Read more >
Placing a Bastion in a Private Isolated Subnet | AWS re:Post
Hello, I have an RDS instance placed in a Private Isolated Subnet, and I'm trying to create a Bastion that would allow me...
Read more >
Configuring an isolated network in AWS - DEV Community ‍ ‍
2 public and private subnets for Amazon RDS. An Internet Gateway attached to the VPC. NAT gateways attached to the EKS public subnets....
Read more >
RDS Instance Not In Public Subnet | Trend Micro
By provisioning your RDS instances within private subnets (logically isolated sections of AWS VPC) you will prevent these resources from receiving inbound ...
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