If you follow the interactive process to configure credentials, you do not need to specify the options for the credential. You only need to enter the corresponding values when prompted. This configuration method verifies the validity of the credential. Regardless of whether the credential is valid or not, it is written into the configuration file.
Overview
aliyun configure --mode <AuthenticateMode> --profile <profileName>
- --profile: Specify the configuration name. If the specified configuration exists, modify the configuration. If it does not exist, you must create a configuration.
- --mode: Specify the credential type. They are AK, StsToken, RamRoleArn, and EcsRamRole.
- Make sure that you enter the correct AccessKey information. If it is incorrect, the
interface cannot be called.
Note You can create and view your AccessKey on the AccessKey page of the Alibaba Cloud console, or obtain the AccessKey from your system administrator.
- For a complete list of regions supported by Alibaba Cloud, see Regions and zones.
Configure Done !!!
.............. 888888888888888888888 ........ =8888888888888888888D=..............
........... 88888888888888888888888 ..........D8888888888888888888888I...........
.........,8888888888888ZI: ........................... =Z88D8888888888D..........
......... +88888888 .......................................... 88888888D..........
......... +88888888 .......Welcome to use Alibaba Cloud.......O8888888D..........
......... +88888888 ............. ************* ..............O8888888D..........
......... +88888888 .... Command Line Interface(Reloaded) ....O8888888D..........
......... +88888888........................................... 88888888D..........
..........D888888888888DO+. ..........................? ND888888888888D..........
...........O8888888888888888888888...........D8888888888888888888888=...........
............ .:D8888888888888888888......... 78888888888888888888O ..............
Configure AccessKey credential
In the Alibaba Cloud CLI, the AccessKey credential type is named AK
. It is the default credential type. Therefore, when using this method to quickly
configure credential, you can ignore --mode
option.
aliyun configure --profile akProfile
Configuring profile 'akProfile' in '' authenticate mode...
Access Key Id []: AccessKey ID
Access Key Secret []: AccessKey Secret
Default Region Id []: cn-hangzhou
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en:
Saving profile[akProfile] ...Done.
Configure STS token credential
If you access Alibaba Cloud by using the StsToken
credential type, you must specify --mode StsToken
.
aliyun configure --profile stsTokenProfile --mode StsToken
Configuring profile 'stsTokenProfile' in 'StsToken' authenticate mode...
Access Key Id []: AccessKey ID
Access Key Secret []: AccessKey Secret
Sts Token []: StsToken
Default Region Id []: cn-hangzhou
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en:
Saving profile[stsTokenProfile] ...Done.
Configure RamRoleArn credential
If you access Alibaba Cloud by using the RamRoleArn
credential type, you must specify --mode RamRoleArn
.
aliyun configure --profile ramRoleArnProfile --mode RamRoleArn
Configuring profile 'ramRoleArnProfile' in 'RamRoleArn' authenticate mode...
Access Key Id []: AccessKey ID
Access Key Secret []: AccessKey Secret
Ram Role Arn []: RamRoleArn
Role Session Name []: RoleSessionName
Default Region Id []: cn-hangzhou
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en:
Saving profile[ramRoleArnProfile] ...Done.
Configure EcsRamRole credential
If you access Alibaba Cloud by using the EcsRamRole
credential type, you must specify --mode EcsRamRole
.
aliyun configure --profile ecsRamRoleProfile --mode EcsRamRole
Configuring profile 'ecsRamRoleProfile' in 'EcsRamRole' authenticate mode...
Ecs Ram Role []: EcsRamRole
Default Region Id []: cn-hangzhou
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en:
Saving profile[ecsRamRoleProfile] ...Done.
EcsRamRole
credential type, see the Instance RAM role overview.