mitchellh / vagrant-aws

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

Fog-aws to support AWS elbv2 #561

Open cedricmckinnie opened 4 years ago

cedricmckinnie commented 4 years ago

Heads up!

When trying to configure aws.elb in my project, I encountered a mysterious issue that I think may haunt other vagrant-aws users in the future. Upon executing a vagrant up command I ran into this error message:

"ELB configured for the instance does not exist"

Explanation

Given that I was 100% sure that the ELB did in fact exist, it took a bit of debugging to realize that vagrant-aws currently can only register an instance to classic load balancers and not application load balancers.

Vagrant-aws 0.7.2 depends on the fog-aws-2.0.1 gem which currently does not support AWS elbv2 ALBs as specified by this pull request.

https://github.com/fog/fog-aws/pull/400

Verification Test

A quick test to prove this is to create a Classic Load Balancer and and Application Load Balancer then run

aws elb describe-load-balancers and aws elbv2 describe-load-balancers

Respective results will be logged. Fog-aws can only describe elb's

Possible Solutions

1) Merge the related fog-aws PR

2) Add a dependency to a different ruby-based AWS SDK to be able to retrieve elbv2s

3) Enhance error logging to let users know that they can only register classic load balancers to an instance using the vagrant CLI.

For now I chose option 3 since it does not matter for my use case however, I expect others may in the future have a more strict need.

Thanks!