com.amazonaws.services.servicediscovery.model.DnsRecord Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servicediscovery Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.servicediscovery.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A complex type that contains information about the Route 53 DNS records that you want Cloud Map to create when you
* register an instance.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DnsRecord implements Serializable, Cloneable, StructuredPojo {
/**
*
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. You
* can specify values for Type
in the following combinations:
*
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify A
or
* AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when you
* register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for HealthCheckConfig
.
* If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses the
* following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the AWS_INSTANCE_PORT
* attribute when you submit a RegisterInstance request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or AAAA
* records that have the same name as the value of service-hostname
in the SRV
record. You
* can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to specify the
* correct name format.
*
*
*
*
*
*/
private String type;
/**
*
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that an
* alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you submit a RegisterInstance request,
* the TTL
value is ignored. Always specify a TTL for the service; you can use a service to register
* instances that create either alias or non-alias records.
*
*
*/
private Long tTL;
/**
*
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. You
* can specify values for Type
in the following combinations:
*
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify A
or
* AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when you
* register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for HealthCheckConfig
.
* If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses the
* following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the AWS_INSTANCE_PORT
* attribute when you submit a RegisterInstance request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or AAAA
* records that have the same name as the value of service-hostname
in the SRV
record. You
* can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to specify the
* correct name format.
*
*
*
*
*
*
* @param type
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS
* queries. You can specify values for Type
in the following combinations:
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify
* A
or AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when
* you register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as
* 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for
* HealthCheckConfig
. If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses
* the following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be
* changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the
* AWS_INSTANCE_PORT
attribute when you submit a RegisterInstance
* request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or
* AAAA
records that have the same name as the value of service-hostname
in the
* SRV
record. You can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to
* specify the correct name format.
*
*
*
*
* @see RecordType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. You
* can specify values for Type
in the following combinations:
*
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify A
or
* AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when you
* register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for HealthCheckConfig
.
* If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses the
* following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the AWS_INSTANCE_PORT
* attribute when you submit a RegisterInstance request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or AAAA
* records that have the same name as the value of service-hostname
in the SRV
record. You
* can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to specify the
* correct name format.
*
*
*
*
*
*
* @return The type of the resource, which indicates the type of value that Route 53 returns in response to DNS
* queries. You can specify values for Type
in the following combinations:
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify
* A
or AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when
* you register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as
* 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for
* HealthCheckConfig
. If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses
* the following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be
* changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the
* AWS_INSTANCE_PORT
attribute when you submit a RegisterInstance
* request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or
* AAAA
records that have the same name as the value of service-hostname
in the
* SRV
record. You can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to
* specify the correct name format.
*
*
*
*
* @see RecordType
*/
public String getType() {
return this.type;
}
/**
*
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. You
* can specify values for Type
in the following combinations:
*
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify A
or
* AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when you
* register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for HealthCheckConfig
.
* If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses the
* following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the AWS_INSTANCE_PORT
* attribute when you submit a RegisterInstance request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or AAAA
* records that have the same name as the value of service-hostname
in the SRV
record. You
* can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to specify the
* correct name format.
*
*
*
*
*
*
* @param type
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS
* queries. You can specify values for Type
in the following combinations:
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify
* A
or AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when
* you register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as
* 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for
* HealthCheckConfig
. If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses
* the following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be
* changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the
* AWS_INSTANCE_PORT
attribute when you submit a RegisterInstance
* request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or
* AAAA
records that have the same name as the value of service-hostname
in the
* SRV
record. You can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to
* specify the correct name format.
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecordType
*/
public DnsRecord withType(String type) {
setType(type);
return this;
}
/**
*
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. You
* can specify values for Type
in the following combinations:
*
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify A
or
* AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when you
* register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for HealthCheckConfig
.
* If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses the
* following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the AWS_INSTANCE_PORT
* attribute when you submit a RegisterInstance request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or AAAA
* records that have the same name as the value of service-hostname
in the SRV
record. You
* can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to specify the
* correct name format.
*
*
*
*
*
*
* @param type
* The type of the resource, which indicates the type of value that Route 53 returns in response to DNS
* queries. You can specify values for Type
in the following combinations:
*
* -
*
* A
*
*
* -
*
* AAAA
*
*
* -
*
* A
and AAAA
*
*
* -
*
* SRV
*
*
* -
*
* CNAME
*
*
*
*
* If you want Cloud Map to create a Route 53 alias record when you register an instance, specify
* A
or AAAA
for Type
.
*
*
* You specify other settings, such as the IP address for A
and AAAA
records, when
* you register an instance. For more information, see RegisterInstance.
*
*
* The following values are supported:
*
*
* - A
* -
*
* Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44.
*
*
* - AAAA
* -
*
* Route 53 returns the IP address of the resource in IPv6 format, such as
* 2001:0db8:85a3:0000:0000:abcd:0001:2345.
*
*
* - CNAME
* -
*
* Route 53 returns the domain name of the resource, such as www.example.com. Note the following:
*
*
* -
*
* You specify the domain name that you want to route traffic to when you register an instance. For more
* information, see Attributes in the topic RegisterInstance.
*
*
* -
*
* You must specify WEIGHTED
for the value of RoutingPolicy
.
*
*
* -
*
* You can't specify both CNAME
for Type
and settings for
* HealthCheckConfig
. If you do, the request will fail with an InvalidInput
error.
*
*
*
*
* - SRV
* -
*
* Route 53 returns the value for an SRV
record. The value for an SRV
record uses
* the following values:
*
*
* priority weight port service-hostname
*
*
* Note the following about the values:
*
*
* -
*
* The values of priority
and weight
are both set to 1
and can't be
* changed.
*
*
* -
*
* The value of port
comes from the value that you specify for the
* AWS_INSTANCE_PORT
attribute when you submit a RegisterInstance
* request.
*
*
* -
*
* The value of service-hostname
is a concatenation of the following values:
*
*
* -
*
* The value that you specify for InstanceId
when you register an instance.
*
*
* -
*
* The name of the service.
*
*
* -
*
* The name of the namespace.
*
*
*
*
* For example, if the value of InstanceId
is test
, the name of the service is
* backend
, and the name of the namespace is example.com
, the value of
* service-hostname
is the following:
*
*
* test.backend.example.com
*
*
*
*
* If you specify settings for an SRV
record, note the following:
*
*
* -
*
* If you specify values for AWS_INSTANCE_IPV4
, AWS_INSTANCE_IPV6
, or both in the
* RegisterInstance
request, Cloud Map automatically creates A
and/or
* AAAA
records that have the same name as the value of service-hostname
in the
* SRV
record. You can ignore these records.
*
*
* -
*
* If you're using a system that requires a specific SRV
format, such as HAProxy, see the Name element in the documentation about CreateService
for information about how to
* specify the correct name format.
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecordType
*/
public DnsRecord withType(RecordType type) {
this.type = type.toString();
return this;
}
/**
*
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that an
* alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you submit a RegisterInstance request,
* the TTL
value is ignored. Always specify a TTL for the service; you can use a service to register
* instances that create either alias or non-alias records.
*
*
*
* @param tTL
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that
* an alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you
* submit a RegisterInstance
* request, the TTL
value is ignored. Always specify a TTL for the service; you can use a
* service to register instances that create either alias or non-alias records.
*
*/
public void setTTL(Long tTL) {
this.tTL = tTL;
}
/**
*
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that an
* alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you submit a RegisterInstance request,
* the TTL
value is ignored. Always specify a TTL for the service; you can use a service to register
* instances that create either alias or non-alias records.
*
*
*
* @return The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that
* an alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you
* submit a RegisterInstance
* request, the TTL
value is ignored. Always specify a TTL for the service; you can use a
* service to register instances that create either alias or non-alias records.
*
*/
public Long getTTL() {
return this.tTL;
}
/**
*
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that an
* alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you submit a RegisterInstance request,
* the TTL
value is ignored. Always specify a TTL for the service; you can use a service to register
* instances that create either alias or non-alias records.
*
*
*
* @param tTL
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
*
*
* Alias records don't include a TTL because Route 53 uses the TTL for the Amazon Web Services resource that
* an alias record routes traffic to. If you include the AWS_ALIAS_DNS_NAME
attribute when you
* submit a RegisterInstance
* request, the TTL
value is ignored. Always specify a TTL for the service; you can use a
* service to register instances that create either alias or non-alias records.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DnsRecord withTTL(Long tTL) {
setTTL(tTL);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getTTL() != null)
sb.append("TTL: ").append(getTTL());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DnsRecord == false)
return false;
DnsRecord other = (DnsRecord) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getTTL() == null ^ this.getTTL() == null)
return false;
if (other.getTTL() != null && other.getTTL().equals(this.getTTL()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getTTL() == null) ? 0 : getTTL().hashCode());
return hashCode;
}
@Override
public DnsRecord clone() {
try {
return (DnsRecord) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.servicediscovery.model.transform.DnsRecordMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}