title: How do I use the only_if for regions in EC2 instances
body: <p>I'm trying to setup a only_if recipe, I only want file1 to be used in our East region and File2 to be using in the West region. The results right now is, the client bypasses the cookbook (file) because of the only_if. I looked at the logs, but they are not very informative. So I'm at a lost as to why its not working. </p>
  
  <p>I have also tried this way with the same negative results.<br>
  node[ec2][placement_availability_zone]</p>
  
  <pre><code>cookbook_file "/dir/dir/dir/file.json" do
  only_if { node['ec2']['region'] == "us-east-1"}
    source "dir/file1.json"
    owner "user"
    group "group"
    action :create
    notifies :restart, "service[app-client]", :delayed
  end
  
  cookbook_file "/etc/dir/dir/file.json" do
  only_if { node['ec2']['region'] == "us-west-2"}
    source "dir/file2.json"
    owner "user"
    group "group"
    action :create
    notifies :restart, "service[app-client]", :delayed
  end
  </code></pre>
  
  <p>Here is the ohai results on the same server.</p>
  
  <pre><code>ohai | grep region
    "dm_region_hash": {
    "json?": "{\n  \"devpayProductCodes\" : null,\n  \"privateIp\" :        \”0.0.0.0\”,\n  \"availabilityZone\" : \"us-west-2c\",\n  \"version\" : \”date\”,\n  \"region\" : \"us-west-2\",\n  \"instanceId\" : \”ID\”,\n  \"billingProducts\" : null,\n  \"instanceType\" : \"t2.micro\",\n  \"accountId\" : \"\",\n  \"kernelId\" : null,\n  \"ramdiskId\" : null,\n  \"architecture\" : \"x86_64\",\n  \"imageId\" : \”ami-111111\”,\n  \"pendingTime\" : \”date\time\”\n}”,
  </code></pre>