I have a static website hosted on an S3 bucket. The website takes a file as an input and uploads it to another S3 bucket. I don't want to keep the bucket as public. How can I upload a file to a non-public bucket? Currently, I'm using my access key to upload a file, but I don't want to expose the access key in my Javascript code for authentication. My objective is to upload a file to a non-public bucket without exposing my access credentials.
Edit1: I used the amazon API gateway with Lambda to generate pre-signed S3 URL. This way my credentials don't get exposed.