-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(appsync): expose the AppSyncDomain of the custom domain of an AppSync api #21554
feat(appsync): expose the AppSyncDomain of the custom domain of an AppSync api #21554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that makes sense. let's update the comment then to make this clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
…pSync api (aws#21554) 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: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license