LoginSignup
0
0

More than 3 years have passed since last update.

awscli のクレデンシャル関係コマンドの備忘録

Last updated at Posted at 2019-11-06

MFA 必須のマルチアカウント構成で AWS を利用する場合に必要なコマンドの備忘録です。

トークンの取得

.aws/config
[profile project-profile]
region=ap-northeast-1
mfa_serial = arn:aws:iam::000000000000:mfa/your-iam-user-name
role_arn = arn:aws:iam::111111111111:role/OrganizationAccountAccessRole
source_profile = master-profile
command
aws --profile project-profile sts get-caller-identity

キャッシュされたクレデンシャルのクリア

command
rm -r ~/.aws/cli/cache

CodeCommit 用 Credential Helper

command
aws --profile project-profile codecommit credential-helper $@
.git/config
[credential]
        helper = !aws --profile project-profile sts get-caller-identity >&2 && aws --profile project-profile codecommit credential-helper
        UseHttpPath = true

Reference

0
0
1

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