class RecordTarget
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Route53.RecordTarget |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsroute53#RecordTarget |
![]() | software.amazon.awscdk.services.route53.RecordTarget |
![]() | aws_cdk.aws_route53.RecordTarget |
![]() | aws-cdk-lib » aws_route53 » RecordTarget |
Type union for a record that accepts multiple types of target.
Example
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
declare const myZone: route53.HostedZone;
declare const distribution: cloudfront.CloudFrontWebDistribution;
new route53.AaaaRecord(this, 'Alias', {
zone: myZone,
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
});
Initializer (protected)
super(values?: string[], aliasTarget?: IAliasRecordTarget)
Parameters
- values
string[]
— correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses). - aliasTarget
IAlias
— alias for targets such as CloudFront distribution to route traffic to.Record Target
Properties
Name | Type | Description |
---|---|---|
alias | IAlias | alias for targets such as CloudFront distribution to route traffic to. |
values? | string[] | correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses). |
aliasTarget?
Type:
IAlias
(optional)
alias for targets such as CloudFront distribution to route traffic to.
values?
Type:
string[]
(optional)
correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses).
Methods
Name | Description |
---|---|
static from | Use an alias as target. |
static from | Use ip addresses as target. |
static from | Use string values as target. |
static fromAlias(aliasTarget)
public static fromAlias(aliasTarget: IAliasRecordTarget): RecordTarget
Parameters
- aliasTarget
IAlias
Record Target
Returns
Use an alias as target.
static fromIpAddresses(...ipAddresses)
public static fromIpAddresses(...ipAddresses: string[]): RecordTarget
Parameters
- ipAddresses
string
Returns
Use ip addresses as target.
static fromValues(...values)
public static fromValues(...values: string[]): RecordTarget
Parameters
- values
string
Returns
Use string values as target.