amazon-web-servicesspring-bootaws-java-sdk

Why am I getting 504 Gateway Time-out after updating aws-java-sdk version in Spring-Boot app on AWS?


I am having a spring boot app and it's deployed over the AWS EKS cluster. There is one maven dependency 'aws-java-sdk' . Earlier it was running fine with the older version - 1.11.52, but when I have updated the version to - 1.12.470. It start giving me 504 Gateway Time-out error.

 <dependency>
   <groupId>com.amazonaws</groupId>
   <artifactId>aws-java-sdk</artifactId>
   <version>1.12.470</version>
 </dependency>

Also check with cloudwatch related to HTTP Errors, no errors are coming.


Solution

  • I was able to solve it by adding only the dependency I need-

      <dependency>
         <groupId>com.amazonaws</groupId>
         <artifactId>aws-java-sdk-sts</artifactId>
         <version>1.12.472</version>
      </dependency>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-rds</artifactId>
        <version>1.12.472</version>
      </dependency>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-cognitoidp</artifactId>
        <version>1.12.472</version>
      </dependency>
    

    The problem with aws-sdk-java is that it download the complete jars package which are the part of aws sdk ecosystem and the others jars may conflict with the EKS causing the issues. One more thing that all the aws-sdk jars version should be exact same, since internally they have dependency on other aws jars as well which also might create problems.

    It was advisable to use the relevant jars that you needed, not the complete package.