0
votes

I am trying to create Worker Environmenton EBS with Sample Application of Node js which should use existing Security group on VPC.

I create this environment inside VPC (Virtual Private Cloud).

When I create this environment, I keep following configuration for VPC. Security Group which is selected here is already exist.

VPS Configuration

In the next screen, I also select instance profile and service role which also exist.

VPC Configuration and permission

While I create Environment with this setting, It does create Environment fine but it always create new Security group instead of using existing security group.

New Security Group created

Why it always create new Security group and not use existing one ? I want to reuse Security group and not create separate for each worker environment.

Appreciate if someone can guide me in right direction.

Thanks in advance.

2

2 Answers

2
votes

Beanstalk uses the security group you asked for, but on creation it also creates a unique one for that configuration. If you launch your instance it will be in the security group as expected.

1
votes

Instead of stopping it from being created, was able to modify its rules such that I changed to just allow port 22 access only from my private security group.

Namespace: aws:autoscaling:launchconfiguration
OptionName: SSHSourceRestriction
Value: tcp, 22, 22, my-private-security-group

Visit : https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#SSHSourceRestriction