VPC with only private subnet fails with error
See original GitHub issue❓ General Issue
The Question
Because creating a VPC with default settings creates a public and private subnets that default to a NAT gateway for each public subnet, i am running out of EIP. My application doesnt even need a NAT gateways, its just an app that uses dax to connect to dynamodb. Anyways, i tried creating a vpc with just private subnet and add dynamo as a gateway endpoint:
const daxVpc = new Vpc(this, 'daxVpc', {
cidr: Vpc.DEFAULT_CIDR_RANGE,
subnetConfiguration: [{
subnetType: SubnetType.PRIVATE,
name: defaultSubnetName(SubnetType.PRIVATE)
}],
gatewayEndpoints: {
DYNAMODB: {
service: GatewayVpcEndpointAwsService.DYNAMODB
}
}
});
but it errors out during deployment:
8/31 | 16:24:34 | CREATE_IN_PROGRESS | AWS::EC2::Subnet | daxVpc/IsolatedSubnet1/Subnet (daxVpcIsolatedSubnet1SubnetA090FC82) Resource creation Initiated
8/31 | 16:24:34 | CREATE_IN_PROGRESS | AWS::EC2::Subnet | daxVpc/IsolatedSubnet2/Subnet (daxVpcIsolatedSubnet2Subnet469D29C8) Resource creation Initiated
9/31 | 16:24:34 | CREATE_COMPLETE | AWS::EC2::RouteTable | daxVpc/IsolatedSubnet2/RouteTable (daxVpcIsolatedSubnet2RouteTableE102F846)
10/31 | 16:24:34 | CREATE_COMPLETE | AWS::EC2::RouteTable | daxVpc/IsolatedSubnet1/RouteTable (daxVpcIsolatedSubnet1RouteTable5B90AC7F)
11/31 | 16:24:36 | CREATE_FAILED | AWS::EC2::Route | daxVpc/IsolatedSubnet1/DefaultRoute (daxVpcIsolatedSubnet1DefaultRoute54F632D7) Exactly one of [EgressOnlyInternetGatewayId, InstanceId, NatGatewayId, TransitGatewayId, GatewayId, VpcPeeringConnectionId, NetworkInterfaceId] must be specified and not empty
What configuration am i missing ??
Environment
- CDK CLI Version: 1.3.0
- Module Version: 1.3.0
- OS:
- Language: TypeScript
Other information
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Troubleshoot connection to an instance in an Amazon VPC
Open the Amazon VPC console. · In the navigation pane, under Virtual Private Cloud, choose Subnets. · In the content pane, select the...
Read more >AWS CDK Getting Error when try to initialize a new VPC with ...
This is happening because EKS is trying to make the cluster use Private and Public subnets in the VPC, and there are no...
Read more >Elastic beanstalk deployment in private subnet of the VPC is ...
Elastic beanstalk deployment in private subnet of the VPC is failing with following error when public subnet ACL inbound is deny all ·...
Read more >API error messages - IBM Cloud Docs
If you are using the CLI, run the command ibmcloud is subnets to list all the subnets for the VPC. Then, run the...
Read more >My EC2 instance in a private subnet can't connect ... - YouTube
We appreciate your feedback: https://amazonintna.qualtrics.com/jfe/form/SV_a5xC6bFzTcMv35sFind more details in the AWS Knowledge Center: ...
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
yea, na, that wouldnt work. it needs to connect to dynamo which resides outside the vpc…
just having
errors out:
There are no ‘Private’ subnets in this VPC. Use a different VPC subnet selection. Subprocess exited with error 1
I have a similar issue, where whether using a NAT Gateway or not (i.e specifyng nat_gateways=0 or =1+) will result in a route with destination 0.0.0.0/0 but no target at all:
e.g.
will create a route as follow for each of the Subnets created, with no target specified: