mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

InvalidParemeter - Empty groupId ? #459

Open jstriedinger opened 8 years ago

jstriedinger commented 8 years ago

Hey guys! Usting Vagrant for the first time with Dokku for my Rails project. I'm having a big headache with something I can not explain. The console is throwing that error: InvalidParameterValue => value() for parameter groupId is invalid. The value cannot be empty This is my Vagrantfile:

`box.vm.provider :aws do |aws, override|

        aws.access_key_id     = ENV['AWS_ACCESS_KEY_ID']
        aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
        aws.keypair_name      = 'jstriedinger'

        aws.ami               = 'ami-50946030'
        aws.region            = 'us-west-2'
        aws.instance_type     = 't2.micro'

        aws.security_groups   = ['sg-0ae5b46d']

        aws.block_device_mapping = [
            {
                :DeviceName => "/dev/sdb",
                :VirtualName => "ephemeral0"
            },
            {
                :DeviceName => "/dev/sdc",
                :VirtualName => "ephemeral1"
            }
        ]

        override.ssh.username = 'ubuntu'

        # Customize this to your AWS keypair path
        override.ssh.private_key_path = '~/.ssh/jstriedinger.pem'
    end

`

Now. To the details. I got the AMI from the EC2 AMI locator with filters to region (US-WEST-2), name (Trusty) and Instance Type (hvm:ebs). So I know is correct. A proof the my Security Group IS, in fact, for the us-west-2 region: image

As you can see my Security Group IS for that region, so that is correct too. Now, you can see here that IS my keypair name: image

And yeah, I have it in the correcto folder.

Anyway, what the F is going on!? This is so annoying, is killing and making waste so much time. PLEASE HELP.

DanHam commented 8 years ago

Hi jstriedinger,

I was running into the same issue. Using the value under the 'Group Name' column for your security group not the 'Group ID' solved the issue for me. Given the screen-shot you've provided your vagrant file should instead have:

... aws.security_groups = ['launch-wizard-1'] ...

You may find you want to replace the 'launch-wizard-1' name with something a little more descriptive! Unfortunately you have to delete and recreate the rule to do this.

Hope that helps

Dan

verofa commented 7 years ago

HI jstriedinger, I had the same error but I have just solved it and work for me. My problem was that I was setting up in the wrong way the value for the aws.region, this value should be the same zone where you have configured the security group.

Error Example: $ vagrant up box1 --provider=aws Bringing machine 'box1' up with 'aws' provider... ... ==> box1: Launching an instance with the following settings... ==> box1: -- Type: t2.micro ==> box1: -- AMI: ami-ba3e14d9 ==> box1: -- Region: us-east-1 ... ==> box1: -- Security Groups: ["MySecurityGroupName"] ... ==> box1: Warning! Vagrant might not be able to SSH into the instance. ==> box1: Please check your security groups settings. There was an error talking to AWS. The error message is shown below:

InvalidParameterValue => Value () for parameter groupId is invalid. The value cannot be empty

Fixed Example: $ vagrant up box1 --provider=aws Bringing machine 'box1' up with 'aws' provider... ... ==> box1: Launching an instance with the following settings... ==> box1: -- Type: t2.micro ==> box1: -- AMI: ami-ba3e14d9 ==> box1: -- Region: ap-southeast-2 ... ==> box1: -- Security Groups: ["MySecurityGroupName"] ... ==> box1: Warning! Vagrant might not be able to SSH into the instance. ==> box1: Please check your security groups settings. ==> box1: Waiting for instance to become "ready"... ==> box1: Waiting for SSH to become available... ==> box1: Machine is booted and ready for use!

Hope that helps as well, V