AWS Builder Center
From a Simple Image Uploader to the Cloud: 5 Lessons I Learned with AWS Amplify and S3

From a Simple Image Uploader to the Cloud: 5 Lessons I Learned with AWS Amplify and S3

In this article, I share five practical lessons from building a simple image uploader with AWS Amplify and Amazon S3. From setting up the backend to uploading images, generating public URLs, and troubleshooting common issues, I walk through what I learned while taking a project from local development to the cloud.

Building applications becomes more interesting when you move beyond writing code that works on your computer and start connecting it to real cloud services.
Recently, I worked on a simple image uploader that allows users to select an image, upload it to cloud storage, and retrieve a link to access the uploaded file.
At first, the idea seemed straightforward. However, getting everything connected and working properly introduced me to some important concepts about AWS Amplify, Amazon S3, backend configuration, and cloud development.
In this article, I’ll share five lessons I learned while building the project and some of the challenges I encountered along the way.

1. Understanding how AWS Amplify Gen 2 simplifies backend development

One of the first things I learned was how AWS Amplify Gen 2 makes it easier to connect frontend applications to cloud services.
Instead of manually setting up every backend resource, Amplify provides a development workflow that allows you to define and manage backend resources using TypeScript.
For this project, I used Amplify Gen 2 to configure the backend and connect the application to Amazon S3.
This helped me understand that building a cloud-connected application doesn't always require creating an entire backend from scratch. Services such as Amplify can simplify the process by providing tools that handle much of the infrastructure setup.

2. Using Amazon S3 to store uploaded images

The next important part was understanding where the uploaded images would actually be stored.
I used Amazon Simple Storage Service (Amazon S3), which provides scalable object storage for files such as images, videos, documents, and other application assets.
Rather than storing images directly inside the application, the uploader sends them to an S3 storage bucket.
This approach is useful because files can be stored separately from the application itself, making them easier to manage as the application grows.
I also learned about storage access paths, including the  public/  path used in the project's storage configuration.
It was a practical introduction to how cloud storage works and how applications can interact with it.

3. Connecting the frontend to the Amplify backend

Having a backend configured is only one part of the process. The frontend also needs to know how to connect to it.
One important file in this workflow is  amplify_outputs.json .
This file contains the generated backend configuration that the frontend uses to connect to the deployed or sandboxed Amplify resources.
During development, I encountered a situation where the file was missing. This prevented the frontend from connecting properly to the backend.
I learned that running the appropriate Amplify sandbox workflow is necessary to provision the backend resources and generate the configuration output.
The command used was:
npx ampx sandbox
This helped me understand the relationship between the backend environment and the frontend configuration.

4. Learning how to upload files and retrieve their URLs

With the backend configured and the frontend connected, I could focus on the actual image-upload functionality.
Amplify provides storage utilities that make this process easier.
Two particularly useful functions are:
 uploadData() 
This function handles uploading a file to the configured storage location.
 getUrl() 
After uploading, this function can be used to retrieve a URL for accessing the stored file, subject to the configured access permissions.
The general workflow looks like this:
  1. A user selects an image from their device.
  1. The application receives the selected file.
  1.  uploadData()  uploads the image to the configured storage location.
  1. The application retrieves an accessible URL using  getUrl() .
  1. The URL can then be displayed or used within the application.
This was one of the most interesting parts of the project because I could see how a relatively small frontend feature could interact with cloud infrastructure.
It also reinforced the importance of configuring storage permissions correctly. A file being uploaded successfully does not automatically mean everyone should be able to access it.

5. Troubleshooting is part of cloud development

Not everything worked perfectly on the first attempt.
One challenge I encountered was the missing  amplify_outputs.json  file. I initially had to investigate why the frontend couldn't access the expected backend configuration.
I also encountered an  InvalidCredentialError  when running:
npx ampx sandbox
This made me realize that configuring an AWS development environment involves more than installing the required packages. The AWS CLI and Amplify tooling also need valid credentials and the appropriate permissions.
I had to pay attention to the AWS credential configuration and understand how the development environment authenticates with AWS.
One important lesson here is to never expose AWS access keys, secret access keys, or other credentials in source code or public repositories. They should be managed securely.
Troubleshooting these issues helped me understand the development process more deeply. Instead of simply following instructions, I had to investigate what was happening between the frontend, backend, and AWS environment.

Bonus: Building with AWS Free Tier

Another interesting part of this experience was the cost.
For this project, I was able to work within the AWS Free Tier, and the project incurred $0 in costs during my development experience.
This was encouraging because it showed me that developers and students can experiment with cloud technologies without necessarily starting with a large infrastructure budget.
However, it's still important to monitor resource usage, understand service pricing, and check the current Free Tier conditions before deploying applications for real users.

Five lessons I took away from the experience

Looking back, this project taught me more than just how to upload an image to cloud storage.
Here are five important lessons:
  1. Understand your tools: Learning how Amplify Gen 2 works makes backend development easier.
  1. Think beyond the frontend: A working interface still needs properly configured cloud infrastructure.
  1. Understand storage permissions: Uploading and accessing files are separate concerns.
  1. Learn to troubleshoot: Errors are part of development, and understanding them improves your technical skills.
  1. Build practical projects: Working on a real feature makes cloud concepts easier to understand.

What's next?

This image uploader is a small project, but it has given me a better understanding of how frontend applications interact with cloud infrastructure.
There is still more to explore, including authentication, access control, file management, and building more complete applications with AWS services.
My next step is to continue experimenting with AWS and applying what I've learned to projects that solve practical problems.

Conclusion

You don't always need to start with a complex application to learn something valuable.
Sometimes, a simple project can introduce you to important technologies and expose you to the real challenges of software development.
For me, building this image uploader was an opportunity to explore AWS Amplify Gen 2, Amazon S3, and the process of connecting a frontend application to cloud services.
I'm looking forward to building more, learning from the challenges, and sharing the journey with the community.
Keep learning. Keep building. Keep experimenting.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article