aws-cdk-lib.aws_route53.RecordTarget

class RecordTarget

LanguageType name
.NETAmazon.CDK.AWS.Route53.RecordTarget
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsroute53#RecordTarget
Javasoftware.amazon.awscdk.services.route53.RecordTarget
Pythonaws_cdk.aws_route53.RecordTarget
TypeScript (source)aws-cdk-lib » aws_route53 » RecordTarget

Type union for a record that accepts multiple types of target.

Example

import * as apigw from 'aws-cdk-lib/aws-apigateway';

declare const zone: route53.HostedZone;
declare const restApi: apigw.LambdaRestApi;

new route53.ARecord(this, 'AliasRecord', {
  zone,
  target: route53.RecordTarget.fromAlias(new targets.ApiGateway(restApi)),
  // or - route53.RecordTarget.fromAlias(new alias.ApiGatewayDomain(domainName)),
});

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 IAliasRecordTarget — alias for targets such as CloudFront distribution to route traffic to.

Properties

NameTypeDescription
aliasTarget?IAliasRecordTargetalias 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: IAliasRecordTarget (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

NameDescription
static fromAlias(aliasTarget)Use an alias as target.
static fromIpAddresses(...ipAddresses)Use ip addresses as target.
static fromValues(...values)Use string values as target.

static fromAlias(aliasTarget)

public static fromAlias(aliasTarget: IAliasRecordTarget): RecordTarget

Parameters

  • aliasTarget IAliasRecordTarget

Returns

  • RecordTarget

Use an alias as target.


static fromIpAddresses(...ipAddresses)

public static fromIpAddresses(...ipAddresses: string[]): RecordTarget

Parameters

  • ipAddresses string

Returns

  • RecordTarget

Use ip addresses as target.


static fromValues(...values)

public static fromValues(...values: string[]): RecordTarget

Parameters

  • values string

Returns

  • RecordTarget

Use string values as target.