aws-cdk-lib.aws_route53_targets.ApiGateway

class ApiGateway

LanguageType name
.NETAmazon.CDK.AWS.Route53.Targets.ApiGateway
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsroute53targets#ApiGateway
Javasoftware.amazon.awscdk.services.route53.targets.ApiGateway
Pythonaws_cdk.aws_route53_targets.ApiGateway
TypeScript (source)aws-cdk-lib » aws_route53_targets » ApiGateway

Implements IAliasRecordTarget

Extends ApiGatewayDomain

Defines an API Gateway REST API as the alias target. Requires that the domain name will be defined through RestApiProps.domainName.

You can direct the alias to any apigateway.DomainName resource through the ApiGatewayDomain class.

Example

import * as route53 from 'aws-cdk-lib/aws-route53';
import * as targets from 'aws-cdk-lib/aws-route53-targets';

declare const api: apigateway.RestApi;
declare const hostedZoneForExampleCom: any;

new route53.ARecord(this, 'CustomDomainAliasRecord', {
  zone: hostedZoneForExampleCom,
  target: route53.RecordTarget.fromAlias(new targets.ApiGateway(api))
});

Initializer

new ApiGateway(api: RestApiBase)

Parameters

  • api RestApiBase

Methods

NameDescription
bind(_record, _zone?)Return hosted zone ID and DNS name, usable for Route53 alias targets.

bind(_record, _zone?)

public bind(_record: IRecordSet, _zone?: IHostedZone): AliasRecordTargetConfig

Parameters

  • _record IRecordSet
  • _zone IHostedZone

Returns

  • AliasRecordTargetConfig

Return hosted zone ID and DNS name, usable for Route53 alias targets.