Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- Service Overview
- Billing
- Getting Started
-
User Guide
- Overview
- Permissions Management
- Environment Management
- Application Management
- Component Management
- Instance Management
- Component Configurations
- Component O&M
- System Settings
- Key Operations Recorded by CTS
-
Best Practices
- CAE Best Practices
- Using CAE to Host Nginx Static File Servers
- Interconnecting GitLab with Jenkins for Automatic Build and Deployment on CAE
- Deploying Components Based on the Dependency Sequence Using the Jenkins Pipeline
- Deploying Spring Cloud Applications to CAE to Automatically Connect to the Nacos Engine
- Graceful Startup of a Spring Cloud Application
- Health Check
- Lifecycle Management
- Sending Event Alarms to WeCom
-
Connecting to the CodeArts Pipeline to Automatically Upgrade CAE Components
- Overview
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to a CodeArts Release Repo
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to the OBS Bucket
- Upgrading a CAE Component After Uploading an Image Built Using the Pipeline to the SWR Image Repository
- Configuring PromQL to Implement Custom Auto Scaling
- Configuring the Interconnection Between CAE and DEW to Help Applications Obtain Encrypted Secrets from DEW
- Deploying ASP.NET Core Applications to CAE
- Connecting the Network Through Enterprise Routes
- API Reference
-
FAQs
- Component Management FAQs
- Environment Management
-
Component Configuration FAQs
- Is Manual Scaling Still Effective When a Scaling Policy Is Configured?
- Can Components Be Scaled Without a Scaling Policy?
- Why Is My Instance Abnormal After Cloud Storage Is Configured?
- What Do I Do If a Component Becomes Not Ready?
- How Does CAE Support Dark Launch?
- How Do I Provide Prometheus Metrics for a Java Application?
- System Configuration FAQs
- Service Resources FAQs
- General Reference
Copied.
Configuring a Secret and Injecting It as an Environment Variable
In this practice, you can add DEW secrets and import them into components as environment variables to protect data.
Creating a DEW Credential
- Log in to DEW.
- Choose Cloud Secret Management Service.
- Click Create Secret and set parameters by referring to Table 1.
Table 1 Secret parameters Parameter
Description
Type
Select Shared secret.
Secret Name
Enter a secret name. In this practice, enter db.
Enterprise Project
ID of the enterprise project to which a secret is bound during creation.
In this practice, select default.
Secret Value
Select Plaintext and enter 123456.
Description
In this practice, leave it blank.
KMS Encryption Key
Select csms/default.
Associated Event
In this practice, select None.
- Click Next. The rotation period cannot be set for shared secrets. Click Next again to confirm the secret information.
- Click OK.
You can view the created secret in the secret list. The default status of a secret is Enabled.
Adding a Secret
- Log in to CAE.
- Choose System Settings.
If KMS CMKFullAccess and CSMS ReadonlyAccess are not granted, grant them as the administrator.Figure 1 Authorization
- Click Edit in the Secret Configuration module.
- Click Create Secret. In the displayed dialog box, select the secret created in Creating a DEW Secret and the required version.
Figure 2 Adding a secret
- Click OK.
Configuring an Environment Variable
- Choose Component Configurations.
- Select the target component.
- Click Edit in the Environment Variables module.
- Click Add Environment Variable and configure the environment variable by referring to Table 2.
Table 2 Configuring an environment variable Parameter
Description
Type
Select Import secret.
Name
Name of an environment variable, for example, test1.
The name must be unique.
Variable/Variable Reference
Select the secret created in Adding a Secret from the drop-down list.
Figure 3 Configuring an environment variable - Click Save in the Operation column. On the Set Environment Variable page, click OK.
- Click Activate Settings in the upper part of the page.
In the dialog box displayed on the right, confirm the configurations and click OK for the configurations to take effect.
Verifying the Configurations
- Choose Instance List.
- Select the target environment and application from the drop-down lists in the upper part of the page, and click the target component.
- Select the target instance and click Remote Login in the Operation column.
- Check the environment variable, which is the same as the secret value in the DEW secret.
Figure 4 Secret value in DEWFigure 5 Environment variable in remote login
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot