3

I have created a Elastic Beanstalk environment and I have a rails app running which is great. However I am unable to assign is to the default security group.

Current config

I have added a screenshot to this post showing the current security group assign. Any help would be appreciated on assigning the .default group!

Thanks

user440762
  • 31
  • 1
  • 2

3 Answers3

3

You can setup a config file to attach existing security groups in .ebextensions

FILE: ./.ebextensions/ec2-securitygroup.config

option_settings:
  aws:autoscaling:launchconfiguration:
    SecurityGroups: name-of-security-group-1, name-of-security-group-2

NOTE: Do not use the Group Name or Group ID, its the Name field/column

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

SecurityGroups

Lists the Amazon EC2 security groups to assign to the EC2 instances in the Auto Scaling group in order to define firewall rules for the instances.

You can provide a single string of comma-separated values that contain the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template. Security group names are case sensitive.

If you use Amazon Virtual Private Cloud (Amazon VPC) with Elastic Beanstalk so that your instances are launched within a virtual private cloud (VPC), specify security group IDs instead of security group names.

elasticbeanstalk-default

Adan Rehtla
  • 131
  • 4
1

You can use the following ebextensions

$ cat .ebextensions/ec2-security-group.config
option_settings:
    aws:autoscaling:launchconfiguration:
       SecurityGroups: sg-1234567

Lists the Amazon EC2 security groups to assign to the EC2 instances in the Auto Scaling group in order to define firewall rules for the instances.

You can provide a single string of comma-separated values that contain the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template. If you use Amazon VPC with Elastic Beanstalk so that your instances are launched within a virtual private cloud (VPC), specify security group IDs instead of a security group name.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-autoscalinglaunchconfiguration

Also you can modify AWSEBSecurityGroup resource via cloudformation template

ALex_hha
  • 7,025
  • 1
  • 23
  • 39
0

Go to the Amazon Console, select EC2. Select your instance. Right-click and select "Networking / Change Security Groups".

John Hanley
  • 4,287
  • 1
  • 9
  • 20