用于Java Sping Boot 3.0的AWS参数存储

e3bfsja2  于 2023-03-16  发布在  Java
关注(0)|答案(1)|浏览(129)

你好,
我遇到了为spring-boot 3.0应用程序配置spring Boot 参数存储的问题。
我添加了以下依赖项

<dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-starter</artifactId>
            <version>3.0.0-M3</version>
        </dependency>
        <dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-starter-parameter-store</artifactId>
            <version>3.0.0-M3</version>
        </dependency>
        <dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-starter</artifactId>
            <version>3.0.0-M3</version>
        </dependency>
        <dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-autoconfigure</artifactId>
            <version>3.0.0-M3</version>
        </dependency>

我的application.properties:

spring.config.import=aws-parameterstore:/config/app

spring.cloud.aws.parameterstore.region=eu-west-1

但是,我仍然遇到一个错误:

Description:

Config data resource '[ParameterStoreConfigDataResource@198c7a4b context = '/config/app', optional = false]' via location 'aws-parameterstore:/config/app' does not exist

Action:

Check that the value 'aws-parameterstore:/config/app' is correct, or prefix it with 'optional:'

我是否遗漏了任何依赖项或其他配置?

uklbhaso

uklbhaso1#

我遇到了同样的问题,并通过添加以下依赖项使其工作:

implementation("org.springframework.cloud:spring-cloud-starter-bootstrap:4.0.1")

相关问题