mitchellh/packer — pull request #885 by rosstimson (2014-02-13 11:05:09+00:00)
Title: Use --url flag rather than --location for ec2-upload-bundle

I encountered a similar issue to [GH729](https://github.com/mitchellh/packer/issues/729) when trying to use eu-west-1 alongside `ec2-upload-bundle`. After reading through the [AMI Tools docs](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/CLTRG-ami-upload-bundle.html) it looks like the location should be set to `EU` which would need an extra `if` statement similar to the [GH729](https://github.com/mitchellh/packer/issues/729) fix at [commit 6898626](https://github.com/mitchellh/packer/commit/68986263f41106860fca8e639c5781f79e71c431).

However, the [AMI Tools docs](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/CLTRG-ami-upload-bundle.html) also states that the `--location` flag is deprecated and to use the `--url` flag and point to the region's endpoint instead ([S3 endpoint docs](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)). This change brings Packer in line with this recommendation.

I'm not a Go coder so maybe this could have been done nicer/cleaner, however the tests are passing and I'm using this build to successfully bundle up `ec-instance` builds to the correct region now.