Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?

More than 3 years have passed since last update.

@shirakia

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

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What is going on with this article?