libraries/ec2.rb
def query_aws_region
        region = node['aws']['region']

        if region.nil?
          if node.attribute?('ec2')
            region = instance_availability_zone
            region = region[0, region.length - 1]
          else
            region = 'us-east-1'
          end
        end
        region
      end
# determine the AWS region of the node
# Priority: User set node attribute -> ohai data -> us-east-1
determine the AWS region of the node
Priority: User set node attribute -> ohai data -> us-east-1
determine the AWS region of the node Priority : User set node attribute - > ohai data - > us - east - 1
def query_aws_region
        region = node['aws']['region']
        if region.nil?
          if node.attribute?('ec2')
            region = instance_availability_zone
            region = region[0, region.length - 1]
          else
            region = 'us-east-1'
          end
        end
        region
      end
def query_aws_region region = node [ 'aws' ] [ 'region' ] if region . nil? if node . attribute? ( 'ec2' ) region = instance_availability_zone region = region [ 0 , region . length - 1 ] else region = 'us-east-1' end end region end
determine the AWS region of the node
Priority: User set node attribute -> ohai data -> us-east-1
determine the AWS region of the node Priority : User set node attribute - > ohai data - > us - east - 1