Configure AWS CLI — Windows
Set Up the AWS Command Line
1 — Download the AWS CLI MSI installer
2 — Run the installer
3 — Open command line and type: aws --version
4 — Add a named profile
- Open CLI and type:
aws configure
- For the AWS Access Key ID
- Go to AWS Console and then My Security Credentials
- Go to Access keys (access key ID and secret access key) and then Create New Access Key
- Go back to CLI
- Set AWS Access Key ID
- Set AWS Secret Access Key
- Set a Default region name: I will set Irland (eu-west-1)
- Default output format: json
That’s it, you have configured your default CLI profile. If you do not specify a profile this will be used by default
Multiple accounts
If you have multiple accounts, you can configure them in your CLI. For that, you need to create multiple profiles.
Basically, you need to follow the steps done before but you need to set a profile name
aws configure --profile SecondAccount
When you are running commands in your CLI, if you do not specify a profile, you are using the default one. If you specify the profile, then for that specific profile you are using the specified profile.
If you specify a profile with
--profile
on an individual command, that overrides the setting specified in the environment variable for only that command.
Get a list of profiles
Conclusion
With AWS CLI you can do the management of all AWS services, including deploy, start, stop, etc. Please find a full list of commands here.