This is a demonstration of how to perform direct uploads to AWS's S3 service from a browser. It's mostly based upon the blog post "Direct Browser Uploading – Amazon S3, CORS, FileAPI, XHR2 and Signed PUTs", with some Java inspiration from the EvaporateJS repo.
There is a Terraform configuration under
src/main/terraform
. You can build the necessary infrastructure to run
each demo as follows.
-
Change into
src/main/terraform
under the demo directory. -
Set the following environment variables:
TF_VAR_AWS_SECRET_KEY
TF_VAR_AWS_ACCESS_KEY
-
Configure the remaining AWS variables in
variables.tf
. -
Run the following to check all is well:
terraform plan
-
Apply the config:
terraform apply
-
Edit
src/main/resources/application.properties
to set the appropriate values. -
Run maven with
mvn
. -
Navigate to http://localhost:8080/.