Some variables and parameters can be extracted from code to be managed in a configuration file. The configuration can be retrieved from the configuration file when the code is executed, facilitating quick changes of parameters and cutting down code maintenance costs. This article describes how to create a configuration item in the ACM console.
To create a configuration item, follow these steps:
Log on to the ACM console, and select the Region as needed in the upper-left corner.
Select Configurations in the left-side navigation pane of the console, and click the Create Configuration button on the right side of the page.
Enter the configuration information on the Create Configuration page, and click Publish.
In ACM, the data model for a configuration is < Namespace+DataId+Group, Content >. You do not need to apply for a Data ID and Group. The only requirement is that they must be unique across a namespace.
The input fields are described as follows:
|Data ID||Configuration ID. Use a naming rule like package.class (for example, com.taobao.tc.refund.log.level) for global uniqueness.
Indicate the business meaning of the configuration in the “class” section.
Use lower case for all characters. Use alphabetical letters and one or more of these four special characters (“.”, “:”, “-“, “_”) only, and up to 256 characters are allowed.
|Group||Configuration group (namespace). You can use product name (such as “ACM”) or the module name for uniqueness.
You can perform authentication by group.
Use alphabetical letters and one or more of these four special characters (“.”, “:”, “-“, “_”) only, and up to 128 characters are allowed.
|Tags||You can use tags to manage configurations according to your own dimensions. Up to 5 tags are allowed, and the maximum length of each tag is 32 characters.|
|Description||Configure description information to help others understand the meaning of the configuration. Up to 128 characters are allowed.|
|Associated Application||Name of the application associated with the configuration.|
|Target Region||Most users publish the configuration to the current region only. To publish the configuration to multiple regions, select all target regions.|
|Beta Publish||Select the check box after “Beta” and enter the name of the server for Beta publish.|
|Data Encryption||If the configuration contains sensitive data, we recommend that you use encrypted storage function to minimize the risk of data leakage. You must activate Key Management Service (KMS), and authorize ACM to encrypt and decrypt with your KMS before you can use this function, because ACM data encryption function uses KMS to encrypt configurations. Note that the Data ID of an encrypted configuration always begins with
|Format Validation||If the configuration is in XML or JSON format, you can select the corresponding radio button, and the ACM console does the format verification for you.|
|Configuration Content||Configuration value. A size of less than 10 KB is perferred, and do no exceed 100 KB at the maximum.|
After the configuration is created, you can see it on the Configuration Management page and run the Sample Code to get the configuration.