Project: Serverless Devs (Orchestration & Management / Scheduling & Orchestration)
File: config.md

title: Config Command description: 'Config Command' position: 6 category: 'Commands' The `config` command is related to key information management, including the configuration, viewing, modification, and deletion of keys. - - - - - - Upon executing `s config -h`, you can view the corresponding help information: ```shell script Usage: s config [commands] [options] Configure vendors account, including Alibaba Cloud, Baidu Cloud, Huawei Cloud, Tencent Cloud, etc. Document: https://serverless.help/t/s/config Options: -h, --help Display help for command Commands: add [options] + Add an account get Get accounts delete Delete an account rename [options] > Rename an account default * Set default account ``` This command includes four sub-commands: The `config add` command allows for the configuration of keys. Users can configure keys using default key templates provided by various vendors or opt for custom key configuration through the `Custom` option. Configuration help can be viewed via `-h/--help`: ```shell script Usage: s config add [options] You can add an account Example: $ s config add $ s config add --AccessKey --SecretKey $ s config add --AccessKeyID --AccessKeySecret --AccountID --SecurityToken $ s config add --keyList key1,key2,key3 --infoList value1,value2,value3 Configuration parameters template for vendors: alibaba: AccessKeyID, AccessKeySecret aws: AccessKeyID, SecretAccessKey baidu: AccessKeyID, SecretAccessKey huawei: AccessKey, SecretKey google: PrivateKeyData tencent: AccountID, SecretID, SecretKey How to get the key:

Options: --AccountID <AccountID> AccountID of key information --AccessKeyID <AccessKeyID> AccessKeyID of key information --AccessKeySecret <AccessKeySecret> AccessKeySecret of key information --SecurityToken <SecurityToken> SecurityToken of key information --SecretAccessKey <SecretAccessKey> SecretAccessKey of key information --AccessKey <AccessKey> AccessKey of key information --SecretKey <SecretKey> SecretKey of key information --SecretID <SecretID> SecretID of key information --PrivateKeyData <PrivateKeyData> PrivateKeyData of key information --kl, --keyList <keyList> Keys of key information, like: --kl key1,key2,key3 --il, --infoList <infoList> Values of key information, like: --il info1,info2,info3 -f, --force Mandatory overwrite key information -h, --help Display help for command ``` | Full Parameter | Abbreviation | Required | Meaning | |--|--|--|--| | AccountID | - | Optional | Default field required for key configuration by some cloud vendors | | AccessKeyID | - | Optional | Default field required for key configuration by some cloud vendors | | AccessKeySecret | - | Optional | Default field required for key configuration by some cloud vendors | | SecurityToken | - | Optional | Default field required for key configuration by some cloud vendors | | SecretAccessKey | - | Optional | Default field required for key configuration by some cloud vendors | | AccessKey | - | Optional | Default field required for key configuration by some cloud vendors | | SecretKey | - | Optional | Default field required for key configuration by some cloud vendors | | SecretID | - | Optional | Default field required for key configuration by some cloud vendors | | PrivateKeyData | - | Optional | Default field required for key configuration by some cloud vendors | | keyList | kl | Optional | For custom configuration in batches when default fields do not meet the requirements | | infoList | il | Optional | For custom configuration in batches when default fields do not meet the requirements | | access | a | Optional | Alias for the key | | force | f | Optional | Force modification/overwrite of already configured key information | Key addition can be performed directly via `config add`: ```shell script $ s config add ? Please select a provider: (Use arrow keys) Alibaba Cloud (alibaba) AWS (aws) Azure (azure) Baidu Cloud (baidu) Google Cloud (google) Huawei Cloud (huawei) Tencent Cloud (tencent) (Move up and down to reveal more choices) ``` After selecting an option, the system will provide interactive guidance: ```shell script s config add ? Please select a provider: Alibaba Cloud (alibaba) Refer to the document for Alibaba Cloud key: https://serverless.help/t/s/alibabacloud ? AccessKeyID: ? AccessKeySecret: ? Please create alias for key pair. If not, please enter to skip (default-2) Alias: default-2 Credential: provider: Alibaba Cloud AccessKeyID: LTAKNA AccessKeySecret: U2qRuI AccountID: 124881 ``` Keys can also be added directly via the command line: ```shell script s config add --AccessKeyID --AccessKeySecret ``` Or add custom content: ```shell script s config add -kl key1,key2,key3 -il info1,info2,info3 ``` Common cloud vendor key configuration content ``` alibaba: AccountID, AccessKeyID, AccessKeySecret, aws: AccessKeyID, SecretAccessKey, baidu: AccessKeyID, SecretAccessKey, huawei: AccessKeyID, SecretAccessKey, azure: KeyVaultName, TenantID, ClientID, ClientSecret, tencent: AccountID, SecretID, SecretKey, google: PrivateKeyData ``` Method of acquiring keys via environment variables: This part may vary according to different documents, so refer to the corresponding document for the `Key-Value` pair of the environment variable. Common cloud vendor key acquisition addresses: - - - The `config get` command allows you to obtain information about configured accounts. Configuration help can be viewed via `-h/--help`: ```shell script $ s config get -h Usage: s config get [options] You can get accounts. Example: $ s config get $ s config get -a demo Document: https://serverless.help/t/s/config Options: -h, --help Display help for command ``` | Full Parameter | Abbreviation | Required | Meaning | |--|--|--|--| | access | a | Optional | Alias for the key | To retrieve details of a configured key, you can use `config get`. For example, to get information for the key with the alias `test`, execute: ```shell script $ s config get -a test test: AccountID: 146468 AccessKeyID: LTAf5Q AccessKeySecret: qDNXp7 ``` To obtain all configured key information, you can use `config get` without any parameters: ```shell script $ s config get default: AccountID: 158465 AccessKeyID: LTAZCW AccessKeySecret: mDLodO test: AccountID: 146468 AccessKeyID: LTAf5Q AccessKeySecret: qDNXp7 release: AccountID: 176635 AccessKeyID: LTAYy3 AccessKeySecret: LhTVB5 ``` The `config delete` command allows you to delete information about configured accounts. Configuration help can be viewed via `-h/--help`: ```shell script $ s config delete -h Usage: s config delete [options] You can delete an account. Example: $ s config delete -a demo Document:

Options: -h, --help Display help for command ``` | Full Parameter | Abbreviation | Required | Meaning | |--|--|--|--| | access | a | Mandatory | Alias for the key | To delete a configured key, you can use `config delete`. For example, to delete the key with the alias `test`, execute: ```shell script $ s config delete -a test Access [test] has been successfully deleted. ``` The `config rename` command allows you to change the name of a configured key. Configuration help can be viewed via `-h/--help`: ```shell script $ s config rename -h Usage: s config rename [options] You can rename an account. Example: $ s config rename --source source --target target Document: https://serverless.help/t/s/config Options: --source <source> Source alias name --target <target> Target alias name -h, --help Display help for command ``` | Full Parameter | Abbreviation | Required | Meaning | |--||--|--| | source | - | Mandatory | Original alias of the key | | target | - | Mandatory | New alias of the key | To change the alias of a configured key, use `config rename`. For example, to change the alias of the key from `test` to `test2`, execute: ```shell script $ s config rename --source test --target test2 Alias: test2 credential: AccessKeyID: AccessKeySecret: AccountID: ``` You can also change the alias interactively by not providing arguments: ```shell script $ s config rename ? Please select need rename alias name: (Use arrow keys) test ``` After selecting the alias to be changed, enter the new target alias: ```shell script $ s config rename ? Please select need rename alias name: default2 ? Please select need rename alias name: default Alias: default credential: provider: Alibaba Cloud AccessKeyID: LTATCU AccessKeySecret: GwvGwT AccountID: 124881 default: true ``` The `config default` command allows you to configure the default key. Configuration help can be viewed via `-h/--help`: ```shell script $ s config default -h Usage: s config default [options] Specify an access as the default. Example: $ s config default $ s config default -a demo Document: https://serverless.help/t/s/config Options: -h, --help Display help for command ``` | Full Parameter | Abbreviation | Required | Meaning | |--||--|--| | access | a | Optional | Alias for the key | You can set the default key information with the `s config default` command. For example, to set the current default key to `demo`, execute: ```shell script $ s config default You can choose an access to set as the default. ? Please select an access: (Use arrow keys) demo demo1 demo2 (Move up and down to reveal more choices) ``` After selection, you will be prompted: ```shell script Access [demo] has been set as default. ``` This is an interactive setting, but you can also directly input `s config default -a demo` to set it. ```shell script $ s config default -a demo Access [demo] has been set as default. ``` For details, refer to: in the section. For details, refer to: in the section.