-
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
Can't update my API key while the old one expired #636
Comments
Any chance to take a look at this? I'm still blocked on this |
Hey @fly1030 would you mind emailing us your Account ID and API ID to [email protected] (with a reference to this issue number)? I'd like to work with our AppSync team to see if we can find a suitable mitigation for you. While you are doing that I will work to see if I can find a suitable workaround from a reproduction standpoint. |
|
@josefaidt any chance there's something I can try? We're still in limbo state. |
following up again, any updates? |
Alright, so we couldn't wait anymore so I went ahead and did 'amplify api remove', then pushed and started from scratch again with amplify add api... It fixed the key problem, but all data is gone. We'll recover the data somehow, but guess that's better than having everything down. Still interested in knowing WA for future references. |
Hey @fly1030 apologies for the delay here, while the team continues to improve the experience if this arises again please remove references to |
I've also marked this as a bug to improve the experience where we have resources dependent on the API key output, which can ultimately be mitigated by removing the two-step process of rotating the API key in favor of a single command. This behavior is documented as a feature request here #598 |
@josefaidt I tried to deploy changes in Amplify Studio but it failed with a message like:
In Amplify Studio under Data modeling -> Manage API authorization mode, I see the new key (da2-NEWKEY), but if I try to Save & deploy, I get an error like above and everything reverts. Running
I got the 2 Lambda functions working by manually changing the MYAPP_GRAPHQLAPIKEYOUTPUT in Configuration -> Environment variables. I can get my local application working by manually changing How can I get my deployed application running again? I can't afford to lose the data, I have a presentation on it at re:Invent which I need to complete in a week or so. :( I think the previous time my API key expired, I just extended it in Amplify Studio. What is the best practice for rotating keys? Or should I be using Cognito or IAM? |
In my case, the old key was deleted, not just expired. Should this be a separate issue? |
I am currently facing the same challenge with deleted, expired keys. I also have lambdas that are dependent on the keys too, which makes the entire process messy. |
@josefaidt @sammyiyke Here's a summary of what (I think) worked:
to
|
Thanks for sharing Ed, very useful information for later reference! |
I'm also facing this issue with deleted API keys. Trying what @josefaidt suggested and @ejmiller2 demonstrated above did not work for me. I tried with both
and
while having
Any suggestions on how to work around this? |
The fact that there is no easy way to update an expired API key and that the fix took me HOURS to do is beyond stupid. I can't believe a team of engineers can see a ticket like this and say "Yup, we designed this well." Its an API key; updating it when it expired is one of the most trivial operations an engineer can do. So thank you for making me jump through 30 hoops to do so 🙄 |
Judging from the answers I think we just needed to say to amplify "here we are again" and using the CLI to push a dumb change made the trick for me. What I have done is to:
AppSync console will be like: Not super hard after all. ❤️ |
Thank you! Howwwwwwwwww do you discover this procedure? Thank you!!! you re my life savior |
Me again doing some updates. I have face this issue several times (As I have been on and off working on this project for few months now). The best comment is the one from ejmiller2 which will help us to have the system back and running, however, there are cases where you still have API Key access with 401 errors cause API Key doesn't get updated, if you go AppSync console > settings > API Keys and you see yours expired, you need to: After doing ejmiller2 comment, push a dummy update on the schema to trigger an API Key update. Otherwise, whenever you have a model with API Key access (for guest unauthorised users) it will fail |
Simply adding Really hope this issue is fixed eventually because this is probably my fifth time needing to do this over the last 2 years. |
I've similar issue, but my Stack is in |
I am getting the exact same issue...dying. |
This is still an issue. I have an application I use for ~1 week a year and every year I spend a ton of time fixing broken crap like API keys :| I feel like this should just work |
Here's what worked for me: dive into your Tweak that file by adding in Next up, jazz things up with your very own custom APIKeyExpirationEpoch. Just slot in Boom, you're golden! Give amplify status a quick click to double-check your handiwork! |
After many many many frustrating hours trying everything I could find to resolve the issue described here, I finally got my env back up by following a modified version of the solution here:
I had tried and failed with the same procedure previously, because I hadn't realized that the repeated checkouts were necessary (I skipped them because I had already checked out the env). This whole experience has been really frustrating, and it makes me regret having chosen Amplify for my app framework. |
However: after all this, I went back to Amplify Studio, and none of the "Manage content" functionality was working. The drop-down has my tables, but they show no content in the tables and I can't add records. I've tried:
This issue is true now in all four of my environments across two separate AWS accounts. While it's possible that the failure is unrelated to this issue here, everything was working a few days ago and all I've done since was wrestle with getting these API keys updated. |
This is what fixed my Amplify Studio Data Manager:
Honestly, this whole experience has been a nightmare — and I see that, even after I edit my keys to be valid for longer, new deployments reset to 30 days. So I guess I have to manually deploy or extend the keys every 30 days, otherwise I face this nightmare again and again. It's a completely baffling design for an app framework that's intended for production apps. |
To everyone in this thread, you can simply update the expiration date for your expired keys if you aren't rotating them. Go to your AppSync API in the console > settings > edit api key > adjust the expiration date. Expiration dates can be as far as 365 days in the future. |
@curtismorte, the trouble is that the API keys are no longer there to adjust once they have expired. Or, if they are for some period post-expiration, they certainly were no longer there by the time I got to mine — and others seem to have had a similar issue. Once the keys are gone, you're well and truly in trouble, and you begin the nightmarish sequences to try to recover your app. |
I'll second what @chrislrobert said. Our production environment is fine, but our staging env hadn't been used in a awhile and the API key lapsed in that environment. I'm weary of following the steps in this thread as the documentation for As a work-around I've been manually changing the API key in the config files to one I generated in the AppSync dashboard. |
I had to do this process today. I did steps 1, 2, 4, 5, 7 and it worked for me. |
I'm having a similar issue. My stack is in At this point, I can't remember what I did exactly. I believe the api key was expired and at some point, deleted the api key in app sync, created a new one. I've tried
The api key it is referencing is one that is found in my At this point, not sure what direction to go. Any help would be appreciated! |
@parvusville I'm having the same issue. |
I found that although it seems redundant to repeatedly |
I found some documentation regarding CreateAPIKey here: https://docs.amplify.aws/gen1/react/tools/cli-legacy/config-params/ |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
16.13.2
Amplify CLI Version
9.1.0
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.
Amplify Categories
api
Amplify Commands
push
Describe the bug
Part of the issue here is in #598, where I also commented
Expected behavior
Expect an easier way to update API key used in deployed version
Reproduction steps
Refer to description, there are exact steps
GraphQL schema(s)
# Put schemas below this line
Project Identifier
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: