0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IAM Identity Centerを使ったマルチアカウント運用。

Posted at

はじめに

初投稿の記事で「IAM Identity Center」を扱いましたが、CLIメインのお話でした。

今回は少し別視点でマルチアカウントの場合はどんな感じになるのかを検証してみました。

IAM Identity Centerの設定方法

OrganizetionsへのAWSアカウント追加

紐づけたいAWSアカウントは事前にOrganiztionsへの登録が必要です。

今回はmoriというアカウントを追加しておきました。

スクリーンショット 2024-10-11 5.19.42.png

アカウントとの紐付けのみ

紐づけたいアカウントを選んで、ユーザーまたはグループを割り当てを選択。

スクリーンショット 2024-10-11 5.19.50.png

割り当てるIAM Identity Center側で作ったユーザ(またはグループ)を設定。

スクリーンショット 2024-10-11 5.20.15.png

紐づける権限セットを付与。

スクリーンショット 2024-10-11 5.20.27.png

これだけで、AWS access portalからログインできるようになります!

スクリーンショット 2024-10-11 5.22.30.png

ショートカット機能

AWS access portalには、ショートカット作成機能というものがありました。

これは特定のアカウントで、特定のサービスへ直接アクセスできるURLを作成する機能の模様。

スクリーンショット 2024-10-11 5.24.36.png

本番系アカウントのCloudWatch Logs等、よく使うような場所をショートカットに入れておくと便利そうです!

CLIも。

マルチアカウント状態でCLIのセットアップもしてみました。

aws configure ssoを使った設定時にどっちのアカウントを使うかの選択肢がでるようになってました。

% aws configure sso             
SSO session name (Recommended): test
SSO start URL [None]: https://d-xxxxxxxxxxx.awsapps.com/start/#
SSO region [None]: ap-northeast-1
SSO registration scopes [sso:account:access]: sso:account:access
Attempting to automatically open the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:

https://device.sso.ap-northeast-1.amazonaws.com/

Then enter the code:

KZQC-MTZG
There are 2 AWS accounts available to you.
> mori, mori.xxxxx@gmail.com (111111111111)               
  chelky, doanxxxxx@gmail.com (222222222222)  

それぞれのアカウントで別のprofile名を付けておき、それぞれでaws sso loginをしていると、同時に複数アカウントへの操作が可能です!

IAM Identity Centerが使えないときは?

Privateウインドウ

会社のアカウント等で、IAM Identity Centerが使えないときは、プライベートウインドウ(シークレットウインドウ)がおすすめです!

一つのブラウザで複数のアカウントに同時ログインできるので、マルチアカウントでログインし直したりする必要がなくなります!

まとめ

機能は概ね事前に知っていましたが、いざ構築してみるととっても便利!

でも、今の職場のアカウントだと使えなくて、業務改善できないのは少し残念。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?