AWS Secrets Manager 後端

Spring Cloud Config Server 支援 AWS Secrets Manager 作為組態屬性的後端。您可以透過新增對 AWS Java SDK for Secrets Manager 的相依性來啟用此功能。

pom.xml
<dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>secretsmanager</artifactId>
</dependency>

以下組態使用 AWS Secrets Manager 用戶端來存取密碼。

spring:
  profiles:
  	active: awssecretsmanager
  cloud:
    config:
      server:
        aws-secretsmanager:
          region: us-east-1
          endpoint: https://us-east-1.console.aws.amazon.com/
          origin: aws:secrets:
          prefix: /secret/foo
          profileSeparator: _

AWS Secrets Manager API 憑證是使用 預設憑證提供者鏈 來判斷。

  • 當未指定應用程式時,application 為預設值,而當未指定 Profile 時,則使用 default

  • ignoreLabel 設定為 true 時,labeldefaultLabel 屬性都會被忽略。