36
24

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.

ほんの一瞬だけ使えたら満足なんです。一瞬だけクレデンシャルを拝借させていただけませんでしょうか

Posted at

そういったときのワンライナー
CloudShellのクレデンシャルを拝借します。

CloudShell
curl -s -H "X-aws-ec2-metadata-token: $AWS_CONTAINER_AUTHORIZATION_TOKEN" $AWS_CONTAINER_CREDENTIALS_FULL_URI \
    | jq -r "[\"export AWS_ACCESS_KEY_ID=\" + .AccessKeyId, \"export AWS_SECRET_ACCESS_KEY=\" + .SecretAccessKey,\"export AWS_SESSION_TOKEN=\" + .Token] | .[]"

出力

export AWS_ACCESS_KEY_ID=ASI.....
export AWS_SECRET_ACCESS_KEY=cs5.....
export AWS_SESSION_TOKEN=IQoJb3JpZ2luX2VjEN3//////////.....

これを使いたい環境コピーしたらOK。

参考サイト

これらを組み合わせただけです。いつもお世話になっております。m(_ _)m

36
24
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
36
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?