Elastic Beanstalk CLI launches EC2 instance in a private subnet

0

I use the following command in 'eb cli' to launch an environment:

eb create django-env --vpc.id vpc-02aa477474b131595 --instance_type "t2.micro" --vpc.elbsubnets subnet-089ebed3884dd1aae,subnet-066970ae1c353cfa0 --vpc.ec2subnets subnet-066970ae1c353cfa0,subnet-089ebed3884dd1aae --vpc.securitygroup sg-0cd283febb838a4e4

Explaining what I entered exactly:

-vpc.id : A VPC with 4 subnets, 2 public and 2 private -instance_type: the free tier EC2 instance type -vpc.elbsubnets: the subnets the vpc would be launched in -vpc.ec2subnets: the subnets the EC2 instances would be launched in -vpc.securitygroup : security group of the VPC

When I launch the environment, the EC2s are launched in a private subnet How can I fix this?

2 Answers
0

Hello.

Is the subnet specified in this option a private subnet?
In that case, I don't think it would be strange to start EC2 in a private subnet.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

--vpc.ec2subnets subnet-066970ae1c353cfa0,subnet-089ebed3884dd1aae
profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
0

--vpc.elbsubnets subnet-089ebed3884dd1aae,subnet-066970ae1c353cfa0 --vpc.ec2subnets subnet-066970ae1c353cfa0,subnet-089ebed3884dd1aae

The ELB subnets are the same as the EC2 subnets, just in a different order.

Is this intended?

profile picture
EXPERT
Steve_M
answered 2 months ago

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