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.

There are no 'Private' subnet groups in this VPC. Available types: Public

See original GitHub issue

I’m trying to create a new RDS instance in an isolated subnet of a VPC that I’m creating.

Reproduction Steps

const rdsVpc = new ec2.Vpc(this, 'MyVpc', {
	natGateways: 0,
	subnetConfiguration: [
		{
			cidrMask: 28,
			name: 'rds',
			subnetType: ec2.SubnetType.ISOLATED
		}
	]
});

const dbInstance = new rds.DatabaseInstance(this, 'MyRdsInstance', {
	engine: rds.DatabaseInstanceEngine.POSTGRES,
	instanceClass: new ec2.InstanceType('t3.micro'),
	masterUsername: 'admin',
	databaseName: 'mydb',
	masterUserPassword: this.dbSecretManager.secretValue,
	vpcPlacement: {
		subnetType: SubnetType.ISOLATED
	},
	vpc: rdsVpc
});

Error Log

There are no ‘Private’ subnet groups in this VPC. Available types: Public

Environment

  • CLI Version : 1.31.0
  • **Framework Version: **
  • OS : MacOS Catalina
  • Language : Typescript

This is 🐛 Bug Report

Issue Analytics

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

github_iconTop GitHub Comments

61reactions
evan-beatdappcommented, Apr 8, 2021

If anyone stumbles on this and nothing above fixed it - try deleting cdk.context.json.

3reactions
shiromoto-juncommented, Apr 1, 2022

I was looking for a solution for “There are no’Public’ subnet groups in this VPC. Available types:” and got here.

If you create the VPC and subnet in a separate stack, vpc.publicSubnets and vpc.privateSubnets will return an empty array. Do you need a special way to register a subnet in your VPC?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CDK: There are no 'Private' subnet groups in this VPC after ...
In my case, I was using a VPC created in CDK itself with only ISOLATED subnets. const vpc = new ec2.Vpc(this, 'private_vpc', {...
Read more >
awslabs/aws-cdk - Gitter
There are no 'Public' subnet groups in this VPC. Available types: so, it's trying to do some read of AWS to get data...
Read more >
VPC with public and private subnets (NAT)
The instances in the public subnet can send outbound traffic directly to the internet, whereas the instances in the private subnet can't. Instead,...
Read more >
@aws-cdk/aws-ec2 - npm
A default VPC configuration will create public and private subnets. However, if natGateways:0 and subnetConfiguration is undefined, default VPC configuration ...
Read more >
AWS VPC Subnet Groups - Rohan Chakravarthy
Every Subnet Group entry in the subnetConfiguration list creates a subnet per AZ in the VPC. There is no way to specify different...
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