dignoe / whenever-elasticbeanstalk

Allows you to run cron jobs easily on one or all AWS Elastic Beanstalk instances.
MIT License
48 stars 35 forks source link

Use instance region from EC2 Metadata instead of specifying region #14

Closed jufemaiz closed 10 years ago

jufemaiz commented 10 years ago

AWS EC2 Metadata (/opt/aws/bin/ec2-metadata) can provide an instance's region via its availability zone in much the same method as the instance_id is obtained.

In this case:

availability_zone = `/opt/aws/bin/ec2-metadata -z | awk '{print $2}'`.strip
region = availability_zone[0..availability_zone.length-1]
jufemaiz commented 10 years ago

https://github.com/dignoe/whenever-elasticbeanstalk/pull/10

jufemaiz commented 10 years ago

Fixed in https://github.com/dignoe/whenever-elasticbeanstalk/pull/16