infochimps/cluster_chef — Issue #91: Can't launch clusters in availability zones that aren't in your current knife[:region] (version_3)
Author: redbeard
Created: 2011-12-23 03:30:31+00:00
State: open

This simply causes an opaque fog error such as:

ERROR: The AMI ID 'ami-2af9741a' does not exist (Fog::Compute::AWS::NotFound)

It tracks down to [line #125 in lib/cluster_chef/discovery.rb](https://github.com/infochimps/cluster_chef/blob/version_3/lib/cluster_chef/discovery.rb#L125):

```ruby
def self.fog_connection
@fog_connection ||= Fog::Compute.new({
:provider => 'AWS',
:aws_access_key_id => Chef::Config[:knife][:aws_access_key_id],
:aws_secret_access_key => Chef::Config[:knife][:aws_secret_access_key],
:region => Chef::Config[:knife][:region]
})
end
```

As AWS doesn't let you launch through the API with availability zones outside the region the connection is for.

IMHO a good resolution would be:

* Ability to launch in any availability zone, or
* A clearer error message "the availability zone you've chosen is incompatible with your region".