dNSName property
Alias resource record sets only: The value that you specify depends on where you want to route queries:
- Amazon API Gateway custom regional APIs and edge-optimized APIs
-
Specify the applicable domain name for your API. You can get the applicable
value using the AWS CLI command get-domain-names:
-
For regional APIs, specify the value of
regionalDomainName
. -
For edge-optimized APIs, specify the value of
distributionDomainName
. This is the name of the associated CloudFront distribution, such asda1b2c3d4e5.cloudfront.net
.
-
For regional APIs, specify the value of
- Amazon Virtual Private Cloud interface VPC endpoint
-
Enter the API endpoint for the interface endpoint, such as
vpce-123456789abcdef01-example-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com
. For edge-optimized APIs, this is the domain name for the corresponding CloudFront distribution. You can get the value ofDnsName
using the AWS CLI command describe-vpc-endpoints. - CloudFront distribution
-
Specify the domain name that CloudFront assigned when you created your
distribution.
Your CloudFront distribution must include an alternate domain name that matches the name of the resource record set. For example, if the name of the resource record set is acme.example.com, your CloudFront distribution must include acme.example.com as one of the alternate domain names. For more information, see Using Alternate Domain Names (CNAMEs) in the Amazon CloudFront Developer Guide.
You can't create a resource record set in a private hosted zone to route traffic to a CloudFront distribution.
- Elastic Beanstalk environment
-
If the domain name for your Elastic Beanstalk environment includes the
region that you deployed the environment in, you can create an alias record
that routes traffic to the environment. For example, the domain name
my-environment.us-west-2.elasticbeanstalk.com
is a regionalized domain name. For Elastic Beanstalk environments that have regionalized subdomains, specify theCNAME
attribute for the environment. You can use the following methods to get the value of the CNAME attribute:- AWS Management Console: For information about how to get the value by using the console, see Using Custom Domains with AWS Elastic Beanstalk in the AWS Elastic Beanstalk Developer Guide.
-
Elastic Beanstalk API: Use the
DescribeEnvironments
action to get the value of theCNAME
attribute. For more information, see DescribeEnvironments in the AWS Elastic Beanstalk API Reference. -
AWS CLI: Use the
describe-environments
command to get the value of theCNAME
attribute. For more information, see describe-environments in the AWS CLI Command Reference.
- ELB load balancer
-
Specify the DNS name that is associated with the load balancer. Get the DNS
name by using the AWS Management Console, the ELB API, or the AWS CLI.
-
AWS Management Console: Go to the EC2 page, choose Load
Balancers in the navigation pane, choose the load balancer, choose the
Description tab, and get the value of the DNS name field.
If you're routing traffic to a Classic Load Balancer, get the value that begins with dualstack. If you're routing traffic to another type of load balancer, get the value that applies to the record type, A or AAAA.
-
Elastic Load Balancing API: Use
DescribeLoadBalancers
to get the value ofDNSName
. For more information, see the applicable guide:- Classic Load Balancers: DescribeLoadBalancers
- Application and Network Load Balancers: DescribeLoadBalancers
-
AWS CLI: Use
describe-load-balancers
to get the value ofDNSName
. For more information, see the applicable guide:- Classic Load Balancers: describe-load-balancers
- Application and Network Load Balancers: describe-load-balancers
-
AWS Management Console: Go to the EC2 page, choose Load
Balancers in the navigation pane, choose the load balancer, choose the
Description tab, and get the value of the DNS name field.
- AWS Global Accelerator accelerator
-
Specify the DNS name for your accelerator:
- Global Accelerator API: To get the DNS name, use DescribeAccelerator.
- AWS CLI: To get the DNS name, use describe-accelerator.
- Amazon S3 bucket that is configured as a static website
-
Specify the domain name of the Amazon S3 website endpoint that you created
the bucket in, for example,
s3-website.us-east-2.amazonaws.com
. For more information about valid values, see the table Amazon S3 Website Endpoints in the Amazon Web Services General Reference. For more information about using S3 buckets for websites, see Getting Started with Amazon Route 53 in the Amazon Route 53 Developer Guide. - Another Route 53 resource record set
-
Specify the value of the
Name
element for a resource record set in the current hosted zone.
Implementation
final String dNSName;