Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rubber - SecurityGroupLimitExceeded exceeded the number of VPC

I was following railscasts to use rubber to deploy my rails app to ec2. I got the following problem:

$ cap rubber:create_staging

..... (omit successful part)

/Users/brian/.rvm/gems/ruby-1.9.3-p327/gems/excon-0.25.3/lib/excon/middlewares/expects.rb:10:in `response_call': SecurityGroupLimitExceeded => You have exceeded the number of VPC security groups allowed per instance. (Fog::Compute::AWS::Error)

how can I avoid this problem?

like image 993
Brian Avatar asked Aug 08 '13 10:08

Brian


People also ask

How many VPCs can you have?

Q. How many subnets can I create per VPC? Currently you can create 200 subnets per VPC. If you would like to create more, please submit a case at the support center.

What is the minimum size subnet that you can have in an Amazon VPC?

The minimum size of a subnet is a /28 (or 14 IP addresses.) for IPv4. Subnets cannot be larger than the VPC in which they are created.


2 Answers

The issue is that by default Rubber is creating different security groups for each role. You will notice the console printing numerous "Creating Security Group #{x}" lines. The max allowed without petitioning is 5 (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html) without petitioning.

First run cap rubber:destroy_all.

To force Rubber to use only one security group go into rubber.yml and set... auto_security_groups: false isolate_security_groups: false

After that it may work, or you may get error saying security groups exists... Go here to read how to access security groups. Once in the panel delete all security groups but "default". http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html#DeleteSecurityGroup

If you are getting errors about rules, then select the "default" user group in the AWS panel . This will bring up the rules. Delete all custom TCP rules. After this everything should work. You may need to repeat deleting groups and rules, since Rubber seems to do a terrible job of managing those.

like image 60
Carlos Cervantes Avatar answered Oct 13 '22 00:10

Carlos Cervantes


You can request the VPC limits for your account to be raised via this form.

like image 28
Assaf Lavie Avatar answered Oct 12 '22 23:10

Assaf Lavie