I am working on a project, where the user can upload an image which will be stored remotely.
I am building a Java web app through Elastic Beanstalk (EB), where the user's images will be stored in Simple Storage Service (S3).
The code required to do this works, however, it only does so remotely. When I run the application locally through WildFly, the user is capable of sending an image to S3, however, when I deploy my WAR to EB, the user cannot do it.
I have tried debugging and no exceptions are thrown, the code simply "stops" at one line. Said line:
s3Client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).withRegion(Regions.US_EAST_1).build();
I have logged multiple messages and have found that the previous line is where the code "breaks". I've thought that perhaps it was because of my region, but I have double checked and it appears to be correct. Therefore, my question is:
How can I let my EB web application interact with my S3 bucket?
I do not understand how and why the code can work perfectly fine locally, but not work at all (without throwing exceptions) remotely. I am, therefore, starting to think that perhaps EB needs configuring to interact with S3 but I am unsure.
Any help would be greatly appreciated.
Thanks.