libraries/ec2.rb
def query_instance_availability_zone
        availability_zone = open('http://169.254.169.254/latest/meta-data/placement/availability-zone/', options = { proxy: false }, &:gets)
        fail 'Cannot find availability zone!' unless availability_zone
        Chef::Log.debug("Instance's availability zone is #{availability_zone}")
        availability_zone
      end
# fetch the availability zone from the metadata endpoint
fetch the availability zone from the metadata endpoint
fetch the availability zone from the metadata endpoint
def query_instance_availability_zone
        availability_zone = open('http://169.254.169.254/latest/meta-data/placement/availability-zone/', options = { proxy: false }, &:gets)
        fail 'Cannot find availability zone!' unless availability_zone
        Chef::Log.debug("Instance's availability zone is #{availability_zone}")
        availability_zone
      end
def query_instance_availability_zone availability_zone = open ( 'http://169.254.169.254/latest/meta-data/placement/availability-zone/' , options = { proxy : false } , & :gets ) fail 'Cannot find availability zone!' unless availability_zone Chef :: Log . debug ( "Instance's availability zone is #{availability_zone}" ) availability_zone end
fetch the availability zone from the metadata endpoint
fetch the availability zone from the metadata endpoint