Prerequisites to use the Amazon CLI version 2 - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Prerequisites to use the Amazon CLI version 2

To access Amazon services with the Amazon CLI, you need an Amazon Web Services account with IAM or IAM Identity Center credentials. When running Amazon CLI commands, the Amazon CLI needs to have access to those Amazon credentials. To increase the security of your Amazon account, we recommend that you only use short-lived credentials when using root or IAM users. You should create a user with least privilege to provide access credentials to the tasks you'll be running in Amazon. For information about best practices, see Security best practices in the IAM User Guide.

Create an IAM or IAM Identity Center administrative account

Before you can configure the Amazon CLI, you need to create an IAM or IAM Identity Center account.

Account creation options
Choose a way to manage your credentials To How to create an account How to configure programmatic access to the account
Amazon Management Console credentials Use short-term credentials corresponding to the root user created during initial account set up, an IAM user, or a federated identity from your identity provider. Open https://portal.aws.amazon.com/billing/signup and follow the online instructions. No additional steps are necessary. To sign in to the Amazon CLI with your Amazon account, see Login for Amazon local development using console credentials
IAM Identity Center Use short-term credentials to access Amazon services. Following the instructions in Getting started in the Amazon IAM Identity Center User Guide. Configure programmatic access by Configuring the to use in the Amazon IAM Identity Center User Guide.
Amazon Identity and Access Management

(Not recommended)

Use long-term credentials to access Amazon services. Following the instructions in Create an for emergency access in the IAM User Guide. Configure programmatic access by Manage access keys for users in the IAM User Guide.

Next steps

After creating an Amazon Web Services account and IAM credentials, to use the Amazon CLI you can do one of the following: