Help us understand the problem. What is going on with this article?

[JAWS-UG CLI] Cognito #1 識別子プールの作成

More than 3 years have passed since last update.

前提条件

Cognito (Identity)への権限

  • Cognito (Identity)に対してフル権限があること。

AWS CLIのバージョン

  • 以下のバージョンで動作確認済

    • AWS CLI 1.8.3
コマンド
aws --version
結果(例)
      aws-cli/1.8.3 Python/2.7.5 Darwin/13.4.0

0 準備

0.1. 識別子プール名の決定

変数の設定
COGNITO_IDPOOL_NAME='s3post'

0.2. 結果表示上限の設定

list-identity-poolsコマンドで必須項目のため、設定します。

変数の設定
COGNITO_MAX_RESULT='60'

0.3. 同名の識別子プールの不存在確認

コマンド
aws cognito-identity list-identity-pools \
        --max-results ${COGNITO_MAX_RESULT} \
        --query "IdentityPools[?IdentityPoolName==\`${COGNITO_IDPOOL_NAME}\`].IdentityPoolId" \
        --output text
結果
      (戻り値なし)

1. 識別子プールの作成

1.1. 識別子プールの作成

変数の確認
cat << ETX

        COGNITO_IDPOOL_NAME: ${COGNITO_IDPOOL_NAME} \

ETX
コマンド
aws cognito-identity create-identity-pool \
        --identity-pool-name ${COGNITO_IDPOOL_NAME} \
        --allow-unauthenticated-identities
結果(例)
      {
        "IdentityPoolId": "ap-northeast-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AllowUnauthenticatedIdentities": true,
        "IdentityPoolName": "s3post"
      }

1.2. 識別子プールIDの取得

コマンド
COGNITO_IDPOOL_ID=$( \
        aws cognito-identity list-identity-pools \
          --max-results ${COGNITO_MAX_RESULT} \
          --query "IdentityPools[?IdentityPoolName==\`${COGNITO_IDPOOL_NAME}\`].IdentityPoolId" --output text ) \
        && echo ${COGNITO_IDPOOL_ID}
結果(例)
      ap-northeast-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

1.3. 識別子プールの確認

コマンド
aws cognito-identity describe-identity-pool \
        --identity-pool-id ${COGNITO_IDPOOL_ID}
結果(例)
      {
        "IdentityPoolId": "ap-northeast-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AllowUnauthenticatedIdentities": true,
        "IdentityPoolName": "s3post"
      }

完了

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした