aws-samples / eb-locustio-sample

AWS Elastic Beanstalk sample code to run the load testing tool, locust.
Apache License 2.0
106 stars 59 forks source link

Error when trying to initialize an environment #3

Closed fltiago closed 6 years ago

fltiago commented 8 years ago

When I try to run:

eb create -i c3.large --scale 1 --envvars TARGET_URL=<my URL> --instance_profile aws-elasticbeanstalk-locust-role --vpc

Note that I'm using the --vpc option to allow me to create an instance inside my VPC.

I got:

INFO: Created security group named: sg-429dcb38
ERROR: Creating security group ingress named: FollowerToMaster failed Reason: The security group 'sg-429dcb38' does not exist
ERROR: Creating security group ingress named: SidewaysWWWRouting failed Reason: The security group 'sg-429dcb38' does not exist

Am I able to create an environment using a --vpc option?

TheBishopOfSoho commented 7 years ago

Im getting this same error, and Im assuming its because I deleted the default VPC for security reasons. When using the --vpc option, it doesnt seem to get picked up by commands running further down the chain. Any ideas how I might work around this?

rossmckelvie commented 7 years ago

I had to modify the resources.conf file to get this to work in VPC, not the GroupName property has changed to GroupId:


    Type: "AWS::EC2::SecurityGroupIngress"
    Properties:
      FromPort: "9876"
      ToPort: "9876"
      GroupId: { "Fn::GetAtt": ["AWSEBSecurityGroup", "GroupId"] }
      IpProtocol: "tcp"
      SourceSecurityGroupId: { "Fn::GetAtt": ["AWSEBSecurityGroup", "GroupId"] }
  FollowerToMaster:
    Type: "AWS::EC2::SecurityGroupIngress"
    Properties:
      FromPort: "5557"
      ToPort: "5558"
      GroupId: { "Fn::GetAtt": ["AWSEBSecurityGroup", "GroupId"] }
      IpProtocol: "tcp"
      SourceSecurityGroupId: { "Fn::GetAtt": ["AWSEBSecurityGroup", "GroupId"] }```
abhiksingh commented 6 years ago

Apologies for the late response. For some reason I wasn't receiving notifications for issues on this repo.

@rossmckelvie your response is the correct way to solve the issue. VPC's are referenced by different properties depending on whether it's the default VPC or a user created one. For user created VPC's you need to specify the ID instead of the name.

Closing this since @rossmckelvie provided the answer.