AWS Secrets Manager 后端
Spring Cloud Config Server 支持将 AWS Secrets Manager 作为配置属性的后端。你可以通过添加 AWS Java SDK for Secrets Manager 的依赖来启用此功能。
<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
是默认值,当未指定配置文件时,default
会被使用。 -
当
ignoreLabel
设置为true
时,label
和defaultLabel
属性都会被忽略。