All Products
Search
Document Center

Configure CLI

Last Updated: Sep 13, 2018

Before using the Alibaba Cloud CLI, run the aliyun configure command to configure the AccessKey that you use to call APIs, the region where the cloud resource is located, and the language to use.

An AccessKey ID and AccessKey Secret are required to verify your identity when using the CLI. You can create the AccessKey on the AccessKey page or obtain it from your system administrator.

A default profile is created after you run the aliyun configure command as shown below.

  1. $ aliyun configure
  2. Configuring profile 'default' ...
  3. Alibaba Cloud Access Key ID [None]: <Your AccessKey ID>
  4. Alibaba Cloud Access Key Secret [None]: <Your AccessKey Secret>
  5. Default Region Id [None]: cn-hangzhou
  6. Default output format [json]: json
  7. Default Language [zh]: zh

Configure multiple user profiles

Alibaba Cloud CLI supports configuring multiple user profiles. You can specify which user profile is used to call the API by using the aliyun configure command with the --profile option as shown in the following example:

$ aliyun configure --profile user1

Run the aliyun configure list command to view the configured user profiles. The profile followed by an asterisk (*) is the profile current in use.

  1. Profile | Credential | Valid | Region | Language
  2. --------- | ------------------ | ------- | ---------------- | --------
  3. default * | AK:***f9b | Valid | cn-beijing | zh
  4. aaa | AK:****** | Invalid | |
  5. test | AK:***456 | Valid | | en
  6. ecs | EcsRamRole:EcsTest | Valid | cn-beijing | en

Configure authentication

You can specify the authentication method to use by using the configure command with the --mode <authenticationMethod> option.

The following are supported authentication methods:

Authentication methods Description
AccessKey Use AccessKey ID and Secret to access Alibaba Cloud services.
StsToken Use STS token to access Alibaba Cloud services.
RamRoleArn Use the AssumeRole role to access Alibaba Cloud services.
EcsRamRole Use the EcsRamRole role to access ECS resources.