-
Notifications
You must be signed in to change notification settings - Fork 79
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
Rotate GraphQL API Key with a command #598
Comments
Hey @SaileshKumar 👋 thanks for raising this and apologies for the delay here!! This |
I'll look to test it next time I have this issue, to be honest we started just using aws cli and bypassing amplify:
|
Hey @SaileshKumar glad to hear you've found a suitable workaround for the time being! I was able to successfully reproduce this behavior using the provided steps. Marking as a bug 🙂 |
Transferring to amplify-category-api to address rotating API keys without two pushes (CreateAPIKey 0, push, CreateAPIKey 1, push) to mitigate effect where the API Key CFN output is not available for dependent resources (i.e. Lambda's) |
Hey I'm seeing the same error after I updated my API key expired and trying the same procedures as mentioned in the repro steps. I did also try to manually edit backend-config.json and *-cloudformation-template.json by removing the api dependencies, but I still can't work it around. @josefaidt do you have any other suggestions that might help? Been stuck on this for quite some time |
Hey @fly1030 👋 can you try the command noted in this comment to see if that mitigates the issue? #598 (comment) |
@josefaidt thanks I did ran aws appsync update-api-key, it works fine, I get output But when I run amplify push after this I'm still getting error because the old API key is missing UPDATE_FAILED GraphQLAPIDefaultApiKey215A6DD7 AWS::AppSync::ApiKey Tue Jul 12 2022 10:29:02 GMT-0700 (Pacific Daylight Time) API key not found: da2-co5n3qihhneebkye42metbz55i (Service: AWSAppSync; Status Code: 404; Error Code: NotFoundException; Request ID: 6e0f62dd-d7fd-46a3-8c5f-aea66066eff8; Proxy: null) |
And if I add CreateAPIKey: 0, I'm still getting the same error too, UPDATE_FAILED functionalphalioDataLoader AWS::CloudFormation::Stack Tue Jul 12 2022 10:43:05 GMT-0700 (Pacific Daylight Time) Output 'GraphQLAPIKeyOutput' not found in stack 'arn:aws:cloudformation:us-west-1:066664793077:stack/amplify-alphalious-dev-223536-apialphalious-A6NMYSS5SFDY/aa49c630-8650-11ec-a32c-02d90265b25f' |
Please follow this comment for a work-around #636 (comment), closing this in favor of that issue. |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v14.18.1
Amplify CLI Version
8.0.3
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
api
Amplify Commands
push
Describe the bug
I have many lambdas that have API as a dependency. Thus when I try to upgrade an API key, I can't just use the CreateAPIKey functionality in parameters.json. When I do I get tons of:
"Output 'GraphQLAPIKeyOutput' not found in stack"
in the output.
What seems to work, is manually removing the references to GraphQLAPIKeyOutput in the backend-config.json, and then pushing with CreateAPIKey 0. After that, revert the changes and push again.
There seems to be also a similar issue for lambdas with dynamodb triggers, I think I have to remove some references there as well from the cloudformation tempaltes.
Expected behavior
Should be able to use CreateAPIKey to manually update the api key.
Reproduction steps
Haven't tried in empty directory, but basically:
GraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: