Class CfnRecordSetGroup.AliasTargetProperty
Alias records only: Information about the AWS resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to route traffic to.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Route53
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AliasTargetProperty : Object, CfnRecordSetGroup.IAliasTargetProperty
Syntax (vb)
Public Class AliasTargetProperty
Inherits Object
Implements CfnRecordSetGroup.IAliasTargetProperty
Remarks
When creating records for a private hosted zone, note the following:
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Route53;
var aliasTargetProperty = new AliasTargetProperty {
DnsName = "dnsName",
HostedZoneId = "hostedZoneId",
// the properties below are optional
EvaluateTargetHealth = false
};
Synopsis
Constructors
AliasTargetProperty() |
Properties
DnsName | Alias records only: The value that you specify depends on where you want to route queries:. |
EvaluateTargetHealth | Applies only to alias records with any routing policy: When |
HostedZoneId | Alias resource records sets only : The value used depends on where you want to route traffic:. |
Constructors
AliasTargetProperty()
public AliasTargetProperty()
Properties
DnsName
Alias records only: The value that you specify depends on where you want to route queries:.
public string DnsName { get; set; }
Property Value
System.String
Remarks
The name of the record that you're creating must match a custom domain name for your API, such as <code>api.example.com</code> .
Your CloudFront distribution must include an alternate domain name that matches the name of the record. For example, if the name of the record 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 record in a private hosted zone to route traffic to a CloudFront distribution.
For failover alias records, you can't specify a CloudFront distribution for both the primary and secondary records. A distribution must include an alternate domain name that matches the name of the record. However, the primary and secondary records have the same name, and you can't include the same alternate domain name in more than one distribution.
For environments that were created before early 2016, the domain name doesn't include the region. To route traffic to these environments, you must create a CNAME record instead of an alias record. Note that you can't create a CNAME record for the root domain name. For example, if your domain name is example.com, you can create a record that routes traffic for acme.example.com to your Elastic Beanstalk environment, but you can't create a record that routes traffic for example.com to your Elastic Beanstalk environment.
For Elastic Beanstalk environments that have regionalized subdomains, specify the CNAME
attribute for the environment. You can use the following methods to get the value of the CNAME attribute:
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.
If you're creating an alias record that has the same name as the hosted zone (known as the zone apex), you can't specify the domain name for a record for which the value of <code>Type</code> is <code>CNAME</code> . This is because the alias record must have the same type as the record that you're routing traffic to, and creating a CNAME record for the zone apex isn't supported even for an alias record.
EvaluateTargetHealth
Applies only to alias records with any routing policy: When EvaluateTargetHealth
is true
, an alias record inherits the health of the referenced AWS resource, such as an ELB load balancer or another record in the hosted zone.
public object EvaluateTargetHealth { get; set; }
Property Value
System.Object
Remarks
Note the following:
If the environment contains a single Amazon EC2 instance, there are no special requirements.
When you create a load balancer, you configure settings for Elastic Load Balancing health checks; they're not Route 53 health checks, but they perform a similar function. Do not create Route 53 health checks for the EC2 instances that you register with an ELB load balancer.
For more information and examples, see Amazon Route 53 Health Checks and DNS Failover in the Amazon Route 53 Developer Guide .
HostedZoneId
Alias resource records sets only : The value used depends on where you want to route traffic:.
public string HostedZoneId { get; set; }
Property Value
System.String
Remarks
Alias records for CloudFront can't be created in a private zone.