class ApiGateway
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Route53.Targets.ApiGateway |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsroute53targets#ApiGateway |
Java | software.amazon.awscdk.services.route53.targets.ApiGateway |
Python | aws_cdk.aws_route53_targets.ApiGateway |
TypeScript (source) | aws-cdk-lib » aws_route53_targets » ApiGateway |
Implements
IAlias
Extends
Api
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
RestApi Base
Methods
| Name | Description |
|---|---|
| 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
Return hosted zone ID and DNS name, usable for Route53 alias targets.

.NET
Go
Java
Python
TypeScript (