Application parameters
Application parameters store configurations, passwords, and other data for your application. During deployment, they are dynamically injected as environment variables into startup and shutdown scripts to improve flexibility and security.
Create and use application parameters
-
Go to the ECS console - Application Management page. On the My Applications tab, click the name of the target application to open its details page.
-
Select the Parameters tab, and then click Create Parameter.
-
In the Create Parameter panel, configure the following settings, and then click OK.
-
Parameter Description: The parameter name, used as an environment variable in the script. For example,
port. -
Disk Category:
-
Custom Parameters: Stores non-sensitive configuration information.
-
Encryption Parameter: Stores sensitive information such as passwords and API keys in encrypted form.
-
-
Set different values for each group:
-
Yes: Specify a different value for each application group. For example, for the
portparameter, set the value forGroup 1to8080and the value forGroup 2to8081. -
No: Set a single value for all application groups.
-
-
-
Use the parameter in the deployment package. In the application's startup script, use
${port}to reference it.start_application() { docker run -d -p ${port}:${port} --name my-application image:latest } start_applicationWhen you publish a deployment package to different application groups,
${port}resolves to the parameter value of each group. For example, it resolves to8080for Group 1 and8081for Group 2.