feat(appsync): expose the AppSyncDomain of the custom domain of an AppSync api#21554
Conversation
mrgrain
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
Let's make the name a bit more user friendly please.
And out of curiosity, what is the difference between appSyncDomainName and the provided domain (myDomainName in the example)?
|
Additionally, please make sure the build is passing. You can see the latest build failure here: #21554 (comment) tl;dr Your change to the example is not compiling. |
The myDomainName in the example is just the string 'api.example.com'. So the example would create a CNAME with the name api.example.com with a value api.example.com. The appSyncDomainName is the cloudfront url of the newly associated custom domain. |
| /** | ||
| * the associated custom AppSync domain, if present | ||
| * | ||
| * @default - no custom associated domain | ||
| */ | ||
| public readonly appSyncDomainName?: string; | ||
|
|
There was a problem hiding this comment.
| /** | |
| * the associated custom AppSync domain, if present | |
| * | |
| * @default - no custom associated domain | |
| */ | |
| public readonly appSyncDomainName?: string; | |
| /** | |
| * The associated domain name provided by AppSync | |
| */ | |
| public readonly appSyncDomainName: string; | |
domainName.attrAppSyncDomainName seems to be always available. Is there a reason why you made this optional at first?
There was a problem hiding this comment.
The domainName resource is only created when you pass the domainName properties in the api. So when creating a minimal api it will not create an AWS::AppSync::DomainName or an AWS::AppSync::DomainNameApiAssociation and therefore you don't have the appSyncDomainName.
There was a problem hiding this comment.
Okay that makes sense. let's update the comment then to make this clear.
There was a problem hiding this comment.
Sorry I only just saw this comment appear. I have changed it a bit to be even more clear when you are requesting the appSyncDomainName without a domainName configuration.
|
I converted the attribute to a getter function so that we can throw an error when no domainName is configured. This is more inline with other modules and makes it easier to use. |
Thanks! I was about to comment about that. 😄 |
mrgrain
left a comment
There was a problem hiding this comment.
Looking good now. Ready to ship if the build passes. 🎉
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
When configuring a custom domain on an AppSync api you couldn't easily get the AppSyncDomainName attribute of the associated AWS::AppSync::DomainName. This fix will expose that attribute so that the provided example doesn't throw errors.
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integto deploy the infrastructure and generate the snapshot (i.e.yarn integwithout--dry-run)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license