应用平台 APPSTAGE-通过IaC分发敏感配置:步骤二:通过IaC发布敏感配置

时间:2024-09-14 16:11:32

步骤二:通过IaC发布敏感配置

业务使用Runtime部署并按照IaC规范配置敏感配置项之后,在部署时Runtime会从STS管理台拉取加密配置项,注入到容器的环境变量中,并通过配置渲染工具将敏感配置渲染到业务的配置文件中。

  1. 在IaC脚本中的业务配置项配置文件中指定敏感配置项坐标。

    此处以在config_records.yaml文件中增加一个名为spring.redis.password的敏感配置项为例。

    spring.redis.password: MicroService/{ServiceName}/{MicroServiceName}/spring.redis.password/default

  2. 在IaC脚本中的业务配置项属性定义文件中,声明该配置项为敏感配置项。

    此处以在config_schema.yaml中声明微服务的敏感业务配置项为例。
    type: object
    properties:
       spring.redis.password:
         format: sensitive

support.huaweicloud.com/usermanual-nuwaruntime/appstage_04_0482.html