简体   繁体   中英

[Error]: AWS credentials are not found in current profile. - ask-cli

After setting up AWS profile using ask-cli (ask init) I used ask clone command to get my skill. Everything worked pretty fine. After I wanted to upload the changes via:

ask lambda upload -f arn:aws:lambda:us-east-1:xxxxx:function:test -s .

I got the error that AWS credentials are not found in current profile. What did do I wrong ? Is there something special to know ? Permission in IAM are also set for admin.

I hope anyone can help. Thanks a lot !

I think you have not initialized the AWS command line before using Ask-cli.

First install the AWS Command Line Interface on your device using the following link : https://docs.aws.amazon.com/cli/latest/userguide/installing.html

Once done please use aws configure command to set up a profile. It will ask you for AWS Access Key ID, AWS Secret Access Key, Default region name and Default output format.

$ aws configure
AWS Access Key ID [None]: *******your key*********
AWS Secret Access Key [None]: *******your key************
Default region name [None]: us-east-1
Default output format [None]: json

To get AWS Access Key ID and AWS Secret Access Key do the following :

  • Open the IAM console.
  • In the navigation pane of the console, choose Users.
  • Choose your IAM user name (not the check box).
  • Choose the Security credentials tab and then choose Create access key.
  • To see the new access key, choose Show. Your credentials will look something like this:

    Access key ID: AKIAIOSFODNN7EXAMPLE

    Secret access key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

To download the key pair, choose Download .csv file. Store the keys in a secure location.

Once set up do the following :

  • Run ask init
  • Select default profile, hit enter.
  • use arrow keys to select default AWS profile you just created.
  • It will lead you to amazon.com login page on your browser.sign-in there and your AWS profile will be assigned with your ask-cli.

Now you are ready to use any ask-cli command which also makes changes to your AWS services.

Note: You can initialize multiple AWS and ask profiles on one device. for this use :

  • $ aws configure --profile user2 to create a new aws command line profile.
  • Then run ask init again.
  • create a new profile and assign your new aws profile to it.
  • Then to use any ask-cli command on this new ask-cli profile, use --profile profileName as the suffix of each ask-cli command. for example :

    ask clone --profile secondUser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM