【问题标题】:Spring Boot Google Cloud Secret ManagerSpring Boot 谷歌云秘密管理器
【发布时间】:2020-11-13 18:10:22
【问题描述】:

我按照setting secret manager with GCP on Spring Boot上的说明,在Google Cloud中创建了一个secret,并在application.properties中添加了以下内容

spring.datasource.password=${sm://DB_PASSWORD}

没用,不过,如果我用SecretManagerTemplate,我可以通过secretManagerTemplate.getSecretString("DB_PASSWORD");得到秘密

但是,我需要在应用程序开始时初始化数据源密码,有人在spring boot中使用过secret manager吗?

【问题讨论】:

    标签: spring spring-boot google-cloud-platform google-secret-manager


    【解决方案1】:

    修改 pom.xml 可以神奇的解决问题

        <properties>
            <spring-cloud.version>Hoxton.SR4</spring-cloud.version>
        </properties>
    

        <properties>
            <spring-cloud.version>Hoxton.SR6</spring-cloud.version>
        </properties>
    

    【讨论】:

      猜你喜欢
      • 2021-01-05
      • 2020-09-06
      • 2021-01-19
      • 2022-06-30
      • 1970-01-01
      • 1970-01-01
      • 2021-09-25
      • 2021-05-18
      • 1970-01-01
      相关资源
      最近更新 更多