Spring Boot newbie here. I am trying to read credentials from AWS Parameter Store. To do that, I have added the following dependencies to pom.xml:
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-parameter-store-config</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.1.4</version>
</dependency>
I am using Spring Boot version version 2.7.4. When I run the application, it fails to boot and prints the following error:
Caused by: java.lang.IllegalStateException: Unable to load config data from 'aws-parameterstore:'
How do I read credentials from AWS parameter store?
Update
There is a parameter stored at the path /config/myap_dev/dummy. I have added the following config to my bootstrap.properties:
spring.application.name=myapp
aws.paramstore.defaultContext=application
aws.paramstore.profileSeparator=_
aws.paramstore.prefix=/config
aws.paramstore.enabled=true
and in my application-dev.yaml I do the following to retrieve the parameter:
spring.config.import: "aws-parameterstore:"
param: "${dummy}"
I am running the application using mvn spring-boot:run.
AWS_EC2_METADATA_DISABLED=trueandcloud.aws.stack.auto=falsewhen not running in AWSAWS_ACCESS_KEY_ID,AWS_REGION, andAWS_SECRET_ACCESS_KEYdefined as environment variables. I addedcloud.aws.stack.auto: falsebut the error still persists.