Thanks to AWS Amplify, building and deploying a static web application has never been easier. This powerful platform simplifies connecting your code repository, configuring build and deployment settings, and managing your app in the cloud. This guide will walk you through the steps to launch your static web application using AWS Amplify.

Step 1: Set Up Your AWS Amplify Environment

Before deploying, you need to set up your AWS Amplify environment. Log into the AWS Management Console and navigate to the Amplify console. If you’re new to AWS, you may need to create an AWS account first.

Once in the Amplify console:

  • Click on “Get Started” under Deploy.
  • Choose “Host your web app”.
  • Select the “Git provider” option that matches your repository’s location (GitHub, Bitbucket, GitLab, etc.).

AWS Amplify will prompt you to authenticate your Git provider, allowing Amplify to access your repositories.

Step 2: Connect to Your Repository

Now that your environment is ready, it’s time to connect to your code repository:

  • Choose the repository where your static web application code is stored.
  • Select the branch you want to deploy (typically, this would be your main or master branch).

AWS Amplify will scan your repository for static web app frameworks and automatically configure build settings.

Step 3: Configure Build and Deploy Settings

After connecting your repository, you must configure the build and deploy settings. Amplify provides a pre-configured amplify.yml file based on the detected framework, but you can customize it to fit your project’s needs.

Key settings to consider:

  • Build Commands: Commands to install dependencies and build your application. For instance, npm install and npm run build for a React app.
  • Environment Variables: If your app requires API keys or other environment variables, you can add them in this step.

Once you’ve reviewed the build settings, click on “Next”.

Step 4: Review and Deploy

With everything configured, you’re now ready to review your settings:

  • Review the connected branch, build settings and environment variables.
  • Ensure that the settings align with your deployment requirements.

Click on “Save and Deploy” to start the deployment process. AWS Amplify will now begin building and deploying your application.

Step 5: Monitor Deployment Progress

AWS Amplify offers a comprehensive deployment dashboard where you can monitor the progress:

  • The dashboard displays logs of the build and deployment stages.
  • If any errors occur during the build, they will be highlighted, allowing you to troubleshoot and redeploy.

Amplify also provides real-time notifications about the deployment status, ensuring you’re always informed.

Step 6: Access Your Deployed Static Web Application

Once the deployment is complete, AWS Amplify will provide a public URL where your static web application is hosted. You can access and share this URL with users to view your deployed application.

Amplify automatically manages your application’s hosting, scaling, and SSL certificates, giving you a secure and scalable hosting solution.

Conclusion

Deploying a static web application with AWS Amplify streamlines the process, from connecting your repository to monitoring deployment progress. Following this guide, you’ve set up your environment, connected your repository, configured build settings, and launched your application into the cloud with minimal effort.

References

Host a Static Website

Quickly deploy server-side rendered apps, static apps, and SPAs