-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-route53-targets): Cannot use SpecRestApi to create ApiGateway target for ARecord #16227
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API Gateway@aws-cdk/aws-route53-targetsbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
Description
I'm trying to use the SpecRestApi to create API Gateway based on the OpenAPI document. To have the ability to use Custom Domain Name I need to create ARecord, but RecordTarget.fromAlias(new ApiGateway(apiGW)) accepts only RestApi class.
Reproduction Steps
Code snipet:
const apiGW = new SpecRestApi(this, 'RestApi', {
apiDefinition: ApiDefinition.fromAsset('open-api.yaml'),
});
const record = new ARecord(this, 'Record', {
zone: HostedZone.fromHostedZoneAttributes(this, 'Route53HostedZone', {
zoneName: dnsZoneName,
hostedZoneId: dnsHostedZoneId,
}),
target: RecordTarget.fromAlias(new ApiGateway(apiGW)),
});
What did you expect to happen?
I'm able to create ARecord with SpecRestApi
What actually happened?
The compiler shows me error Argument of type 'SpecRestApi' is not assignable to parameter of type 'RestApi'.
Environment
- CDK CLI Version : 1.119.0
- Framework Version: 1.119.0
- Node.js Version: 14.17.0
- OS : Ubuntu
- Language (Version): TypeScript (4.3.5)
Other
Suggestion for fix:
on this line need to change apig.RestApi to apig.RestApiBase
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API Gateway@aws-cdk/aws-route53-targetsbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
