gpt4 book ai didi

java - 尝试在 Spring Boot 中配置从 Secret Manager 读取并抛出区域错误

转载 作者:行者123 更新时间:2023-12-01 16:21:16 25 4
gpt4 key购买 nike

我正在尝试遵循此处的答案How to integrate AWS Secret Manager with Spring Boot Application还描述了https://cloud.spring.io/spring-cloud-aws/2.1.x/multi/multi__cloud_environment.html 。它似乎正在尝试从 secret 管理器中读取数据,但是当我的服务启动时,我收到错误

java.lang.IllegalArgumentException:未提供区域。

我已尝试将该区域设置为环境变量并重新启动 intelliJ,但我仍然面临这个问题。因为我不是明确构建客户端的人,所以关于如何设置该区域有什么建议吗?我没有主意了。

添加:

我的 application.yml 文件具有以下设置:

cloud:
aws:
region:
static: us-east-1

secretsmanager:
prefix: /secret
defaultContext: application
profileSeparator: _
failFast: true
name: platform
enabled: true

我添加了云部分以尝试修复错误,但它仍然无法启动

最佳答案

我将该区域添加为 tomcat 启动中环境变量的一部分,它解决了问题

关于java - 尝试在 Spring Boot 中配置从 Secret Manager 读取并抛出区域错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62268758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com