2
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?

More than 5 years have passed since last update.

apex initでIAMを作る段階でError: creating role: NoCredentialProvidersが出る時の対処法

Posted at

AWS lambdaのデプロイ自動化ツールApexですが、initの段階でちょっと躓きました。
apex initするとcredential関連でエラー。

$ apex init


             _    ____  _______  __
            / \  |  _ \| ____\ \/ /
           / _ \ | |_) |  _|  \  /
          / ___ \|  __/| |___ /  \
         /_/   \_\_|   |_____/_/\_\



  Enter the name of your project. It should be machine-friendly, as this
  is used to prefix your functions in Lambda.

    Project name: shirakia-test

  Enter an optional description of your project.

    Project description: 

  [+] creating IAM hoge_lambda_function role
   ⨯ Error: creating role: NoCredentialProviders: no valid providers in chain. Deprecated.
        For verbose messaging see aws.Config.CredentialsChainVerboseErrors

.aws/configaws_access_key_idaws_secret_access_keyが書いてあっても読んでくれないようだった。
aws_access_key_idaws_secret_access_key.aws/credentialsに移動したら解決。
~/.aws/credentialsの中身は以下のような感じ```
[default]
aws_access_key_id = xxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


または、```
export AWS_SDK_LOAD_CONFIG=1

とすると.aws/configの中に書いたままでも読んでくれる。
Apexがaws-sdk-goに依存しており、そっち対応が必要だったという話。

参考

https://github.com/apex/apex/issues/426
https://github.com/aws/aws-sdk-go#aws-shared-config-file-awsconfig

2
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
2
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?