code: def get_availability_zone(vm_):
      '''
      Return the availability zone to use
      '''
      avz = config.get_cloud_config_value(
          'availability_zone', vm_, __opts__, search_global=False
      )
  
      if avz is None:
          return None
  
      zones = _list_availability_zones(vm_)
  
      # Validate user-specified AZ
      if avz not in zones:
          raise SaltCloudException(
              'The specified availability zone isn\'t valid in this region: '
              '{0}\n'.format(
                  avz
              )
          )
  
      # check specified AZ is available
      elif zones[avz] != 'available':
          raise SaltCloudException(
              'The specified availability zone isn\'t currently available: '
              '{0}\n'.format(
                  avz
              )
          )
  
      return avf get_availability_zone(vm_):
      '''
      Return the availability zone to use
      '''
      avz = config.get_cloud_config_value(
          'availability_zone', vm_, __opts__, search_global=False
      )
  
      if avz is None:
          return None
  
      zones = _list_availability_zones(vm_)
  
      # Validate user-specified AZ
      if avz not in zones:
          raise SaltCloudException(
              'The specified availability zone isn\'t valid in this region: '
              '{0}\n'.format(
                  avz
              )
          )
  
      # check specified AZ is available
      elif zones[avz] != 'available':
          raise SaltCloudException(
              'The specified availability zone isn\'t currently available: '
              '{0}\n'.format(
                  avz
              )
          )
  
      return avz
docs: Return the availability zone to use