LoginSignup
0
0

More than 3 years have passed since last update.

aws認証情報が正常に読み込まれずThe security token included in the request is invalidになる

Posted at

いろいろ調べたものの、自分のケースはなかったので書きます。

原因

いろいろ調べた結果、自分のケースはOSの環境変数自体の値が優先して読み込まれていて、~/.aws/credentialの情報を参照してくれていないことが原因でした。

aws configure listで確認すると、 ~/.aws/credentialに記載された情報が読み込まれていません。

過去に環境変数を設定したものがありまして、そちらが読み込まれてます。
(typeがenvとなっています)

$ aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************hoge              env
secret_key     ****************hoge              env
    region                <not set>             None    None

解決法

export AWS_ACCESS_KEY_ID=

AWS_ACCESS_KEY_IDに空文字を設定しました。

$ aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************piyo shared-credentials-file
secret_key     ****************piyo shared-credentials-file
    region                <not set>             None    None

これで大丈夫になりました。

その他

環境変数をunsetしてみたのですが、aws configure listは変わりませんでした。

unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
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