Spring Cloud not picking up configured profile in cloud.aws.credentials.profile-name

Viewed 494

I have a spring boot application where I've been using Spring Cloud AWS.

I'm trying to add a new profile to my ~/.aws/credentials file like so:

[local-dev]
aws_access_key_id=localkey
aws_secret_access_key=localkey

in my application.yml file I've specified which profile to use.

cloud:
  aws:
    credentials:
      profile-name: local-dev
    region:
      static: us-east-1

whenever I start up my Application I get a error saying:

No AWS profile named 'default', com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@1b26fac2: Failed to connect to service endpoint:

When I set the profile name to "default" it does work though. It's like spring is ignoring the profile-name that I've given it in the configuration.

Currently I have set this version of spring cloud in my maven POM file.

<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-aws</artifactId>
    <version>2.2.1.RELEASE</version>
</dependency>
1 Answers

I faced the same issue when using the same Spring Cloud Libraries version - 2.2.1.RELEASE.

After updating the Spring Cloud libraries to 2.2.6.RELEASE everything works fine.

Related