Description
Describe the bug
Trying to add a custom domain name to AppSync fails during cdk deploment with error Resource of type 'AWS::AppSync::DomainNameApiAssociation' with identifier 'null' was not found.
This might be related to the fact that the Route53
service is not used, as the DNS is hosted outside of AWS.
Expected Behavior
Deployment of cdk stack works and custom domain name is mapped to the AppSync API.
Current Behavior
During cdk deploy
the following error appears:
Resource of type 'AWS::AppSync::DomainNameApiAssociation' with identifier 'null' was not found.
Reproduction Steps
This is the TypeScript code used in the cdk stack:
import * as cdk from "aws-cdk-lib";
import * as appsync from "@aws-cdk/aws-appsync-alpha";
const APPSYNC_CERT_ARN = "arn:aws:acm:us-east-1:xxxx:certificate/xxxx";
export class ApiStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const certificate = cdk.aws_certificatemanager.Certificate.fromCertificateArn(
this,
"cert",
APPSYNC_CERT_ARN,
);
const api = new appsync.GraphqlApi(this, "Api", {
name: "my-api",
domainName: {
certificate,
domainName: "my.domain.com",
},
...
});
}
}
APPSYNC_CERT_ARN
refers to the certificate's ARN in us-east-1
region (while AppSync resides in eu-central-1
).
As I do not use Route53
service but host the DNS myself, there is no further code for Route53
configuration. Of course, the DNS entry exists and points to the AWS appsync URL xxx.appsync-api.eu-central-1.amazonaws.com
.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.19.0
Framework Version
No response
Node.js Version
v14.19.1
OS
Debian Linux 11.3
Language
Typescript
Language Version
No response
Other information
No response