Spring boot startup error for AWS application : There is not EC2 meta data available

I was using springframework.cloud.aws.autoconfigure, got the same problem. The reason behind it is, we need to configure region manually when we run application in NON AWS ENVIRONMENT, ie. Local. So put this property in your application-local.properties and you should be good.

cloud.aws.region.static=us-east-1

Found the Issue. I was using spring-cloud-starter-aws-messaging for SQS messaging. The above dependency includes many Auto Detect classes which eventually was firing up even if they were not required.

Instead I have used spring-cloud-aws-messaging which solved the issue along with many other auto detect issues.


If using application.yml I did it with the following

spring:
  application:
    name: App Name
  autoconfigure:
    exclude:
      - org.springframework.cloud.aws.autoconfigure.messaging.MessagingAutoConfiguration
      - org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration
      - org.springframework.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration