5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Amplify Authを完全に削除して初期状態に戻す

Last updated at Posted at 2021-11-28

Amplify Authの削除

AmplifyからAuthを削除するには、以下のコマンドを叩いて、pushします。

amplify auth remove
amplify push

しかし、GraphQL APIの認証にCognitoを使用していた場合、

✖ An error occurred when pushing the resources to the cloud
Template error: instance of Fn::GetAtt references undefined resource 〇〇

のようなエラーが発生してpushできません。GraphQL APIが削除した古いCognito User Poolを参照しているようなので、amplify update api で認証タイプを更新してあげる必要があるようです。

新しいUser Poolを作成している場合は認証タイプでAmazon Cognito User Poolを選択してあげれば良いですが、今回は一度 Amplify Authを完全に削除したいので、API keyを選択

? Choose the default authorization type for the API
❯ API key
  Amazon Cognito User Pool
  IAM
  OpenID Connect

これでamplify pushが成功し、無事Authのリソースが削除できました。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?