Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EC2 security groups where SSH inbound rule isn't first #71

Merged
merged 1 commit into from
Mar 13, 2015

Conversation

ayumi
Copy link
Contributor

@ayumi ayumi commented Mar 13, 2015

Issue with provisioning EC2 instances where security group's SSH inbound 0.0.0.0/0 permission is not at index 0.

Repro:

  1. Create security group "Foo" with rule: Allow inbound port 22 from your IP.
  2. Start an instance with connection.servers.bootstrap, groups: ["Foo"]
  3. Observe Foo. Notice that fog-aws adds the rule SSH inbound 0.0.0.0/0, and it's at index 1.
  4. Start another instance with the same arguments.
  5. Error is gems/excon-0.44.4/lib/excon/middlewares/expects.rb:6:inresponse_call': Duplicate => the specified rule "peer: 0.0.0.0/0, TCP, from port: 22, to port: 22, ALLOW" already exists (Fog::Compute::AWS::Error)` from fog/aws/models/compute/servers.rb:205

This fixes it by checking all ip ranges, not just the first one.

@lanej
Copy link
Member

lanej commented Mar 13, 2015

Great fix thanks @ayumi

lanej added a commit that referenced this pull request Mar 13, 2015
Fix EC2 security groups where SSH inbound rule isn't first
@lanej lanej merged commit e803d81 into fog:master Mar 13, 2015
@geemus
Copy link
Member

geemus commented Mar 13, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants