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?

More than 1 year has passed since last update.

aws-vaultの備忘録

Posted at

aws-vaultについての備忘録です。

インストール

brew install aws-vault

認証情報登録

aws-vault add xxxxx
Enter Access Key ID: XXXXXXXXXXX
Enter Secret Access Key: XXXXXXXXXXX

初期設定

追加された[profile xxxxx]の下にMFAなどの情報を設定する。

~/.aws/config
[profile xxxxx]
region=ap-northeast-1
output=json
mfa_serial=arn:aws:iam::XXXXXXXXXXXX:mfa/xxxxxxxxxx

接続方法

aws-vault exec xxxxx
# 上記のコマンドを実行すると、aws-vaultで登録したキーチェーンのパスワードが求められる
# その後、MFAを入力する
Enter MFA code for arn:aws:iam::XXXXXXXXXXXX:mfa/xxxxxxxxxx:xxxxx

# 下記のコマンドを実行し、接続できているかを確認する(想定しているAWS環境なのかも合わせて確認)
aws s3 ls

セッション期間を確認

env | grep AWS_SESSION_EXPIRATION

セッションが残っている場合

unset AWS_VAULT
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?