How to fix two subnets are needed for Elastic Beanstalk with Docker setup?

0

I've been trying to fix this the last two days with no luck. I'm using eb cli to init the app and create the env. Everything is going well until cloudformation tries to create the loadbalancer. I've got two VPC's one for prod and one for staging. I've got 6 subnets all in different AZs in the prod VPC and 4 subnets all in different AZs in the staging VPC. I keep getting this error and i'm at a stand still at this point. Any help would be much appreciated: "At least two subnets in two different Availability Zones must be specified (Service: AmazonElasticLoadBalancing; Status Code: 400; Error Code: ValidationError; Request ID: xxxxxx; Proxy: null)"

asked a year ago403 views
1 Answer
0
Accepted Answer

I finally figured it out. I have to add the vpc and subnet ids to the the eb create command. It looks some like this:

eb create --vpc.id vpc-xxxxxxxxxxx --vpc.dbsubnets subnet-xxxxxxxxxxx,subnet-xxxxxxxxxxx --vpc.ec2subnets subnet-xxxxxxxxxxx,subnet-xxxxxxxxxxx --vpc.elbsubnets subnet-xxxxxxxxxxx,subnet-xxxxxxxxxxx --vpc.securitygroups sg-xxxxxxxxxxx
answered a year ago
  • I am experiencing something similar when trying to deploy a stack with cdk. Do you know what the equivalent solution would be with cdk?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions