Class AZAffinity

java.lang.Object
software.amazon.awssdk.services.route53.model.AZAffinity
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<AZAffinity.Builder,AZAffinity>

@Generated("software.amazon.awssdk:codegen") public final class AZAffinity extends Object implements SdkPojo, Serializable, ToCopyableBuilder<AZAffinity.Builder,AZAffinity>

Specifies the location that an AZ-affinity resource record set answers DNS queries from. For the location types, from most to least specific, see LocationType. A query matches a location when Route 53 VPC Resolver reports that the query came from an Availability Zone (AZ) in that location. If Route 53 doesn't know which AZ a query came from, the query matches only the record for the Global location type. AZ-affinity routing chooses which record to return. It doesn't restrict which clients can get a record. You must specify both LocationType and LocationId.

To have Route 53 fall back to a less specific location when a resource is unhealthy, associate a health check with each record, or set EvaluateTargetHealth to true for alias records. If every record that matches a query is unhealthy, Route 53 responds with the most specific one.

See Also:
  • Method Details

    • locationType

      public final AZAffinityLocationType locationType()

      The level of the location that LocationId identifies. Valid values, from most to least specific:

      • AvailabilityZone: A single Availability Zone.

      • AvailabilityZoneGroup: A Zone Group, which is a group of Availability Zones in an Amazon Web Services Region.

      • Region: An entire Amazon Web Services Region.

      • Partition: An entire Amazon Web Services partition.

      • Global: All locations.

      We recommend that you create a record for the Global location type so that every query gets an answer. Route 53 responds with it when a query matches no more specific record, or when it's the only healthy record that matches. Without a Global record, Route 53 returns a "no answer" response to queries that don't match any other record.

      If the service returns an enum value that is not available in the current SDK version, locationType will return AZAffinityLocationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from locationTypeAsString().

      Returns:
      The level of the location that LocationId identifies. Valid values, from most to least specific:

      • AvailabilityZone: A single Availability Zone.

      • AvailabilityZoneGroup: A Zone Group, which is a group of Availability Zones in an Amazon Web Services Region.

      • Region: An entire Amazon Web Services Region.

      • Partition: An entire Amazon Web Services partition.

      • Global: All locations.

      We recommend that you create a record for the Global location type so that every query gets an answer. Route 53 responds with it when a query matches no more specific record, or when it's the only healthy record that matches. Without a Global record, Route 53 returns a "no answer" response to queries that don't match any other record.

      See Also:
    • locationTypeAsString

      public final String locationTypeAsString()

      The level of the location that LocationId identifies. Valid values, from most to least specific:

      • AvailabilityZone: A single Availability Zone.

      • AvailabilityZoneGroup: A Zone Group, which is a group of Availability Zones in an Amazon Web Services Region.

      • Region: An entire Amazon Web Services Region.

      • Partition: An entire Amazon Web Services partition.

      • Global: All locations.

      We recommend that you create a record for the Global location type so that every query gets an answer. Route 53 responds with it when a query matches no more specific record, or when it's the only healthy record that matches. Without a Global record, Route 53 returns a "no answer" response to queries that don't match any other record.

      If the service returns an enum value that is not available in the current SDK version, locationType will return AZAffinityLocationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from locationTypeAsString().

      Returns:
      The level of the location that LocationId identifies. Valid values, from most to least specific:

      • AvailabilityZone: A single Availability Zone.

      • AvailabilityZoneGroup: A Zone Group, which is a group of Availability Zones in an Amazon Web Services Region.

      • Region: An entire Amazon Web Services Region.

      • Partition: An entire Amazon Web Services partition.

      • Global: All locations.

      We recommend that you create a record for the Global location type so that every query gets an answer. Route 53 responds with it when a query matches no more specific record, or when it's the only healthy record that matches. Without a Global record, Route 53 returns a "no answer" response to queries that don't match any other record.

      See Also:
    • locationId

      public final String locationId()

      The ID of the location. You can specify only generally available Availability Zones and Zone Groups. Zone Group, Region, and partition IDs must belong to a partition that you can use. Specify the ID in lowercase, in the format that corresponds to LocationType:

      • For AvailabilityZone, the Availability Zone ID (not the Availability Zone name or a Local Zone ID), such as use1-az1.

      • For AvailabilityZoneGroup, the Zone Group that an Availability Zone belongs to (not a Local Zone group), such as us-east-1-zg-1.

      • For Region, the Region code, such as us-east-1.

      • For Partition, the partition name, such as aws.

      • For Global, the value global.

      Returns:
      The ID of the location. You can specify only generally available Availability Zones and Zone Groups. Zone Group, Region, and partition IDs must belong to a partition that you can use. Specify the ID in lowercase, in the format that corresponds to LocationType:

      • For AvailabilityZone, the Availability Zone ID (not the Availability Zone name or a Local Zone ID), such as use1-az1.

      • For AvailabilityZoneGroup, the Zone Group that an Availability Zone belongs to (not a Local Zone group), such as us-east-1-zg-1.

      • For Region, the Region code, such as us-east-1.

      • For Partition, the partition name, such as aws.

      • For Global, the value global.

    • toBuilder

      public AZAffinity.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<AZAffinity.Builder,AZAffinity>
      Returns:
      a builder for type T
    • builder

      public static AZAffinity.Builder builder()
    • serializableBuilderClass

      public static Class<? extends AZAffinity.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.