I want to fetch configuration properties from Parameter Store
on boostrap application, for that I am using io.awspring.cloud:spring-cloud-starter-aws-parameter-store-config:2.3.3
and I run the same configuration on Windows where it works but on linux ec2 instance or WSL2 I am receiving below error message:
AwsParameterPropertySourceNotFoundException: com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY))
but before run it I am doing
export AWS_ACCESS_KEY_ID="xxxx"
export AWS_SECRET_ACCESS_KEY="xxxxx"
I also verify it using printenv
and yes they are there. So the question is why I am receiving ...Unable to load AWS credentials from environment variables AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY...
does anyone know?
EDIT:
Forgot to mention but I use
io.awspring.cloud:spring-cloud-starter-aws-parameter-store-config
with configuration:
cloud:
aws:
credentials:
access-key: ${AWS_ACCESS_KEY_ID}
secret-key: ${AWS_SECRET_ACCESS_KEY}
region:
static: eu-west-1
auto: false
use-default-aws-region-chain: true
stack:
auto: false
But underhood it use DefaultAWSCredentialsProviderChain so it should works like AWS SDK for Java