Before using Alibaba Cloud CLI, you must configure the credential information, region, language, and so on.
Credential type
Alibaba Cloud CLI can use different authentication methods by adding the --mode <authenticationMethod> option after the configure command. The types of credentials supported are shown in the following table.
Authentication method | Description | Interactive configuration credential (fast) | Non-interactive configuration credential |
---|---|---|---|
AK | Use the AccessKey ID and AccessKey Secret to complete the authentication. | Configure AccessKey credential | Configure AccessKey credential |
StsToken | Use the STS Token to complete the authentication. | Configure STS token credential | Configure STS token credential |
RamRoleArn | Use the AssumeRole of the RAM account to complete the authentication. | Configure RamRoleArn credential | Configure RamRoleArn credential |
EcsRamRole | Use the RAM role of an ECS instance to complete the authentication. | Configure EcsRamRole credential | Configure EcsRamRole credential |
Note AccessKey information is not required for the EcsRamRole credential.
Method of configuring credentials
When you configure a credential in Alibaba Cloud CLI, you can select the following two configuration methods and specify the configured credential type.
- Interactive configuration (fast): You only need to enter the corresponding value when prompted. This configuration process is convenient and fast.
- Non-interactive configuration: You must specify the configuration name, credential type, and authentication information required for the corresponding credential.