There are no 'Private' subnet groups in this VPC. Available types: Public
See original GitHub issueI’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:
- Created 3 years ago
- Reactions:1
- Comments:23 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone stumbles on this and nothing above fixed it - try deleting
cdk.context.json
.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?