5
4

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 5 years have passed since last update.

AWS Cognito のIdentity poolに登録されたidentityIdをまとめて削除する。

Posted at

aws cognitoで認証管理しているシステムでは、開発環境などで大量に作成されたidentityIdを削除したくなる時があります。
そんな時、以下のようなcliでaws Cognito Federated Identitesの identity poolに登録されたidentityIdをまとめて削除できます。

POOL_ID="xxxxxxxxxx"
aws cognito-identity list-identities --identity-pool-id $POOL_ID  --max-results 50 | jq '.Identities | .[].IdentityId'  |  awk '{ print "echo delete id... " $1 "; aws cognito-identity delete-identities --identity-ids-to-delete "  $1 }' | sh

上のscriptでは、最大50件削除します。
復旧不可なので、誤って削除しないよう注意しつつ実行を。

5
4
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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?