-
Notifications
You must be signed in to change notification settings - Fork 4k
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
appsync apikey missing dependency on schema? #8168
Comments
Oooh this makes sense. Just to clarify, when you say manually add dependency you mean with |
Yup.
…On Tue, May 26, 2020 at 5:07 PM Mitchell Valine ***@***.***> wrote:
Oooh this makes sense. Just to clarify, when you say manually add
dependency you mean with Construct.addDependency right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8168 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANCTK333IP5T7NACGPFNUOLRTRKURANCNFSM4NIH23NQ>
.
|
I was talking with @serverlessunicorn about this issue and it sounds like it's hitting him and his dev team more often lately... The error coming back is: I see that we already have a dependency declared from the Resolver resource to the API schema resource:
Are we missing a dependency from the API key resource to the API schema resource as well?
Any other ideas? |
@serverlessunicorn I've been trying to recreate this bug but to no avail. I'm guessing the issue has a higher likelihood of arising when the GraphQL Schema is bigger? @fulghum suggested to test by adding a dependency between the Api Key and the Api Schema. Like so api.apiKey().addDependency(api.schema); Unfortunately the property I can add a link between ApiKey and Schema in this PR #9122 and push for it to get merged by the end of next week. If that sounds alright with the two of you? |
Thanks @BryanPan342 😄 Is there an easy way to use the Escape Hatch mechanism to pop open the construct and get the direct CfnResource for the key and schema? Sharing a snippet of that code would enable @serverlessunicorn to try out the idea in his code. In particular, that would prevent him from having to dig around for the right node names in the L2 construct library code to access the right resource objects through the escape hatch. Otherwise... if we are confident that adding an explicit dependency between the Key and the Schema resource objects is safe and correct, then it would be great to get that change in. I'm not super deep on AppSync, so I will defer to you and @MrArnoldPalmer or @shivlaks for the safe thing to do there. Thanks for helping us close up this gap! 😄 |
@fulghum I found a way to make your own api key through the L1 constructs. Thankfully, the @serverlessunicorn I hope this workaround helps! In order to do this and prevent big headache I'm going to list two scenarios:
To learn more about Escape Hatches, see these docs The most important part of all of this is to override the CloudFormation Property, such that AppSync recognizes that Api Key is a legal authentication type: without it, the Api Key will not work. |
Added dependency between the CfnApiKey and CfnSchema. The dependency here is to prevent a `ConcurrencyModificationError` as seen in #8168. We allow this dependency to exist because from referencing the [docs](https://docs.aws.amazon.com/appsync/latest/APIReference/API_CreateApiKey.html#API_CreateApiKey_Errors) there shouldn't be any issue between creating an api key before or after schema creation. Also make ApiKeyConfig correctly configure the ApiKey when used in `additionalAuthorizationModes`. Fixes #9736 Fixes #8168 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I hit ConcurrentModificationExceptions consistently if I don't manually insert a dependency between each Resolver and the schema of its appsync API. (Note that the dependency between the resolver and the API itself is ok.)
Reproduction Steps
Create any appsync schema with multiple dynamo resolvers (though probably any type will have the same problem).
Error Log
ConcurrentModification exceptions, followed by rollback, unless you manually add every dependency by hand
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: