I'm trying to create a mobile app (social network in react native) that can upload images (avatars, posts, etc). I have a java (spring) REST API backend that uses AWS SDK for java v2. I want to be able to upload the images to S3 straight from the mobile app (to reduce load on the backend), and give the mobile app users links to view the photos using a CDN.
To do this, my plan was to create a CloudFront pre-signed upload URL on the backend to send to the mobile app, so that it can upload the image to the S3 bucket, and to the CDN as well, and from the backend, I would be able to create a pre-signed URL to view the image using the CDN[Amazon Cloudfront] (to send that link to the mobile app users so they can view the image). (This idea was from the docs here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html )
The problem is, that I use AWS SDK v2 for java, which does not have the ability to create Cloudfront pre-signed URLs (it was removed from v1 see: https://github.com/aws/aws-sdk-java-v2/issues/370). Assuming my understanding of everything here is correct, that method won't work for me unless I downgrade to v1.
Does anybody know another way that I could generate pre-signed URLs for the CDN from the backend, and/or upload images from the mobile app using AWS, without having to downgrade my backend AWS-SDK version?