ハンズオン(簡易版): IAM Identity Center基礎

3. IdentityStoreグループの作成 (handson-cli-iic-group)

手順の目的

IdentityStoreグループ名"handson-cli-iic-group"を作成します。

設定値の指定

手順に必要な設定値を変数に格納をします。

0. リージョン

リージョンを指定します。

環境変数の設定:

export AWS_DEFAULT_REGION='ap-northeast-1'

1. IdentityStoreグループ表示名

IdentityStoreグループ表示名を指定します。

変数の設定:

IDENTITYSTORE_GROUP_DISPLAY_NAME='handson-cli-iic-group'

2. IdentityStoreグループの説明

IdentityStoreグループの説明を指定します。

変数の設定:

IDENTITYSTORE_GROUP_DESCRIPTION='Group for handson-cli-iic.'

設定値の確認

各変数に正しい設定値が格納されていることを確認します。

変数の確認:

cat << END

  # 0. AWS_DEFAULT_REGION:"ap-northeast-1"
       AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}"

  # 1. IDENTITYSTORE_GROUP_DISPLAY_NAME:"handson-cli-iic-group"
       IDENTITYSTORE_GROUP_DISPLAY_NAME="${IDENTITYSTORE_GROUP_DISPLAY_NAME}"
  # 2. IDENTITYSTORE_GROUP_DESCRIPTION:"Group for handson-cli-iic."
       IDENTITYSTORE_GROUP_DESCRIPTION="${IDENTITYSTORE_GROUP_DESCRIPTION}"

END

各変数について、上の行と下の行の値の内容もしくは形式が同じであることを確認します。 もし異なる場合は、それぞれの手順番号に戻って変数の設定を行います。

処理の実行

IdentityStore IDを取得します。

コマンド:

sso_admin_identity_store_id=$( \
  aws sso-admin list-instances \
    --query "Instances[].IdentityStoreId" \
    --output text \
) \
  && echo ${sso_admin_identity_store_id}

結果(例):

d-xxxxxxxxxx

IdentityStoreグループの作成

IdentityStoreグループを作成します。

変数の確認:

cat << END

  # sso_admin_identity_store_id:"d-xxxxxxxxxx"
    sso_admin_identity_store_id="${sso_admin_identity_store_id}"
  # IDENTITYSTORE_GROUP_DISPLAY_NAME:"handson-cli-iic-group"
    IDENTITYSTORE_GROUP_DISPLAY_NAME="${IDENTITYSTORE_GROUP_DISPLAY_NAME}"
  # IDENTITYSTORE_GROUP_DESCRIPTION:"Group for handson-cli-iic."
    IDENTITYSTORE_GROUP_DESCRIPTION="${IDENTITYSTORE_GROUP_DESCRIPTION}"

END

コマンド:

aws identitystore create-group \
  --identity-store-id ${sso_admin_identity_store_id} \
  --display-name ${IDENTITYSTORE_GROUP_DISPLAY_NAME} \
  --description "${IDENTITYSTORE_GROUP_DESCRIPTION}"

結果(例):

{
  "GroupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "IdentityStoreId": "d-xxxxxxxxxx"
}

完了確認

「IdentityStoreグループ名"handson-cli-iic-group"が存在する。」ことを確認します。

コマンド:

aws identitystore list-groups \
  --identity-store-id ${sso_admin_identity_store_id} \
  --query "Groups[?DisplayName == \`${IDENTITYSTORE_GROUP_DISPLAY_NAME}\`].DisplayName" \
  --output text

結果(例):

handson-cli-iic-group

手順の完了

(参考) マネジメントコンソールの確認

  • IAM Identity Centerダッシュボード ( https://console.aws.amazon.com/singlesignon/home )にアクセスします。

  • 左ペイン "グループ"をクリックします。

  • 検索フォームにグループ名"handson-cli-iic-group"を入力します。

  • グループ名"handson-cli-iic-group"が表示されれば正常です。