Amplify-cli: amplify remove auth: what does it delete?

Created on 8 Apr 2020  路  4Comments  路  Source: aws-amplify/amplify-cli

Which Category is your question related to?
Amplify CLI Auth

Amplify CLI Version
4.18.0

What AWS Services are you utilizing?
Api, Auth, DymanoDB, Lambda, S3

I think I need to delete and recreate my Cognito user pool because I somehow deleted the sns-role and now I can't save anything there. Plus there are some settings I want to change, but I can't because these were set at creation, using Amplify-cli.

I tried using amplify update auth, but that didn't work as expected.

So my next trick will be to remove Auth with amplify remove auth and then re-add a new one with a push in between.

My worry is this big, scary message:

? Are you sure you want to delete the resource? This action deletes all files related to this resource from the backend directory. (Y/n)

My question is: what is it going to delete? I don't want it to delete anything but the user pool and maybe the associated identity pool.

So before I enter Y, I thought I'd ask.

Second question is: When I create and push the new Auth, will it just work with my existing back-end resources that have already been created in the same project with amplify cli, or am I gonna need to somehow re-wire stuff up?

Thanks,

Kim

auth pending-response question

All 4 comments

Hi @kimfucious, amplify remove auth will remove all auth related stacks including any user pool and identity pool. Instead, you could try amplify env pull or amplify env pull --restore (will override changes you've made in your backend with resources you've deployed to the cloud) to restore the sns-role.

Hi @nikhname

Thanks for the reply. Unfortunately the sns-role was deleted from IAM, so I don't think a pull is going to restore it, unless you can explain otherwise.

But I think you've answered my question in that the only things that will get deleted are Auth related, including the user pool and identity pool. Other resources, such as API, Functions, Storage, etc. should remain untouched, correct?

And if I wind up creating a new Auth via amplify cli, I don't need to re-wire anything to allow users authenticating through the new user pool. It should just work, right?

Sure thing @kimfucious. If the sns-role still exists in the stack used by your env it may still be recovered.

But yes to confirm your other resources will be untouched. You should not have to rewire anything from the API end when you create the new Auth roles.

Thanks @nikhname

I could not recover the sns-role for the life of me.

So I wound up removing auth completely and re-adding it.

And, despite the scary (potentially ambiguous?) warning message, it only deleted my auth stuff.

Was this page helpful?
0 / 5 - 0 ratings