How to configure AWS CLI v2 in Windows 10?

Viewed 1095

I just installed AWS CLI v2 on my Windows 10 machine. I tried configuring using aws config command and selecting all the default values. When I run the command, it doesn't throw any error. But when I look for the .aws folder in my user directory, I can't find it. It's not there. I tried enabling hidden items. But still not there. What is the issue? How do I fix this?

I ran aws configure list and this is the output

      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key                <not set>             None    None
secret_key                <not set>             None    None
    region                <not set>             None    None
2 Answers

You were saying I tried creating the credentials, but aws configure is used to configure

  • AWS Access Key Id
  • Secret Access Key

which are already created for a User. I don't think you can create credentials using this command.

To Create the credentials, you can use any of the following:

  1. IAM Web Console.
  2. Using aws iam create-access-key --user-name <iam-user-name>. This returns a JSON object in the following format:
{
    "AccessKey": {
        "UserName": "XXXXX",
        "AccessKeyId": "XXXXX",
        "Status": "Active",
        "SecretAccessKey": "XXXXX",
        "CreateDate": "2020-06-05T11:09:16Z"
    }
}

then you can set these using aws configure. Once completed, there should be two files available in the .aws folder.

  • config
  • credentials

As you had credentials and you already installed CLI for windows. Try configure from command prompt.

  1. Open your command prompt and let's check the cli version. type - aws --version

We check the CLI version here:

enter image description here

  1. now type "aws configure" it will asked for both AWS Access Key Id: Secret Access Key: aws configure command:

enter image description here

That's it. It's best practice to use IAM user instead of root user.

Related