LoginSignup
3
0

More than 1 year has passed since last update.

AWS CLI上からCognito カスタム属性を追加したい

Last updated at Posted at 2021-08-17

背景

Cognitoのカスタム属性を追加する上で、AWS CLIから作業する必要が発生し、備忘録としてメモ。。。
ドキュメントはこちら

前提

追加したいカスタム属性が設定されていること (以下画像であればenvが設定されていること)

スクリーンショット 2021-08-17 14.33.13.png

※もしかしたら必要ないかもしれませんが、筆者は先に設定して作業を行いました。

作業内容

実行コマンドは以下

aws cognito-idp admin-update-user-attributes --user-pool-id xxxxx --username xxxxxxxxxx --user-attributes Name="custom:xxxx",Value="xxxx"

解説

  • user-pool-id xxxxx

"xxxxx"に以下画像の"プールID"の後の文字列を入力
プールIDモザイク.png

  • username xxxxxxxx

"xxxxxxxx"に"ユーザーとグループ"タグにあるカスタム属性を追加したいユーザー名を入力
スクリーンショット 2021-08-17 14.36.41.png

  • user-attributes Name="custom:xxxx",Value="xxxx"

custom:以下"xxxx"には、前提の項目で設定したカスタム属性名を入力(今回は"env"と入力)
Value=以下"xxxx"には、実際に追加したい値を入力

コマンドライン上で行うと、上記コマンド入力後に dquote> と表示される時があります 。その際は、ダブルクォーテーションの数を見直してみてください

参考

3
0
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
3
0