0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS CLIでSSOを使ってログインする方法

0
Last updated at Posted at 2025-08-24

AWS CLIでSSOを使ってログインする方法

AWS IIC(Identity Center)を使用している場合、AWS CLIでSSOを使ってログインすることができます。

IICについての記事はこちら
https://qiita.com/soranjiro/items/8b0c38394b3349891184

認証

SSO(シングルサインオン)を使用してAWS CLIにログインします。

$ aws configure sso
# SSOのセッション名を指定します。
SSO session name (Recommended): <your-session-name>

# 初回は以下を入力
SSO start URL [None]: https://xxxxxxxxxx.awsapps.com/start
SSO region [None]: ap-northeast-1
SSO registration scopes [None]: sso:account:access

# アカウントが複数ある場合は、アカウントを選択
> production, mail@address.com (xxxxx)
  staging, mail@address.com (xxxxx)

# プロファイルを選択
> AdministratorAccess
  DevelopmentAccess
  ReadOnlyAccess

# regionの選択
Default client Region [None]: ap-northeast-1
CLI default output format [None]: json

# localでのプロファイル名を設定
Profile name [None]: <your-profile-name>

セッションの確認

以下のコマンドで、ログインできていることを確認します。

$ aws sts get-caller-identity --profile axi
{
  "UserId": "xxxxxxxxxxxx",
  "Account": "xxxxxxxxxxxx",
  "Arn": "arn:aws:iam::xxxxxxxxxxxx:user/username"
}

これで、SSOを使ってAWS CLIにログインできました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?