如何从Spring Cloud Config Server中的AWS Secret Manager导入属性?

问题描述 投票:0回答:0

Current scenario


我一直在与Spring Cloud Config Server合作,将属性提供给多个Spring Boot Microservices。当前,所有相应的Spring Boot应用程序的不同文件中都提到了所有凭据(数据库和API键)。
application.yaml

但是现在,想在AWS Secret Manager中存储所有Spring Boot应用程序的所有秘密,从配置服务器中获取并将其提供给相应的微服务。因此,从AWS Secret Manager中获取秘密的责任仍然仅保留在配置服务器上。

What we want to achieve

附录1:
我们试图按照下面的春季文档中提到的AWS Secret Manager整合,但似乎并没有击中秘密经理以获取以下机构的秘密。

https://docs.spring.io/spring-cloud-config/reference/server/server/environment-repository/aws-secrets-manager.html, https://docs.spring.io/spring-cloud-config/reference/server/server/environment-repository/aws-secrets-manager-backend.html,

    我们所做的是,我们从配置服务器中的各个应用程序的
  1. What we have tried so far文件中删除了所有秘密属性,并在AWS Secret Manager中创建了以下命名约定的秘密(如上所述):application.yaml
  2. 附件2:
我们尝试使用Config Server的

/secret/<application name>

文件中的there propert在下面的文档中提到的配置:

https://www.baeldung.com/spring-boot-integrate-aws-secrets-manager

在这种情况下,我们可以访问配置服务器中Secret Manager中提到的秘密,但无法将其传递到相应的Spring Boot应用程序。我们尝试直接在相应的Spring Boot应用程序的

spring.config.import
文件中直接提及秘密,但它无法正常工作:

application.yaml
    (此文件在配置服务器上)
  1. application.yaml
application-<application name>.yaml

,是AWS秘密经理中提到的秘密。当我们尝试在配置服务器本身中访问

spring:
    datasource:
        url: ${dbConnStr}
时,它就可以正常工作。

在我们的情况下,上述方法都无法使用。有人知道我们如何将AWS Secret Manager与Spring Cloud Config Server一起使用为其他多个Spring Boot应用程序提供属性?

我面临与您完全相同的问题。您是否设法找到了修复程序或解决方法?任何帮助将不胜感激!


spring spring-boot spring-cloud aws-secrets-manager spring-cloud-config-server
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.