RDS - Isolated subnet
See original GitHub issueNote: 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:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top GitHub Comments
I encountered this issue for both RDS Aurora & Lambdas and was able to work around it by changing from
To
@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 incdk.context.json
.Changed the rds vpcPlacement set to PRIVATE, did a
cdk diff
, it worked and thecdk.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…