Automating deployment of Amplify from S3 bucket

0

I've created a static website to host some photographs. The HTML is in a github repository. My Amplify application automatically deploys when I commit via. git.

The photographs are stored as jpegs in an S3 bucket which I have associated with a second application. Is there a simple way to have this second application also automatically deploy alongside deployments of the first application?

  • How is the second application currently deployed?

asked 2 months ago55 views
1 Answer
0

Yes, there is a way to automate the deployment of your second Amplify application that uses photographs stored in an S3 bucket alongside your first application. Here's how you can approach this:

  1. Use AWS CodePipeline to create a pipeline that integrates both your GitHub repository and S3 bucket.

  2. Configure the pipeline with two source stages:

    • One for your GitHub repository containing the HTML files
    • Another for your S3 bucket containing the photographs
  3. Set up a deployment stage in the pipeline that uses AWS Amplify as the deployment provider. This stage will deploy both the HTML content from GitHub and the photographs from S3 to your Amplify application.

  4. Configure the pipeline to trigger whenever there's a change in either the GitHub repository or the S3 bucket.

This setup will ensure that your Amplify application is automatically updated whenever you make changes to your HTML files in GitHub or add/modify photographs in the S3 bucket.

To implement this, you'll need to:

  1. Create or modify your existing CodePipeline to include both source locations.
  2. Ensure your Amplify application has the necessary permissions to access both the GitHub repository and the S3 bucket.
  3. Configure the deployment stage in CodePipeline to use Amplify Hosting as the deployment provider.

By setting up this pipeline, you'll have a streamlined process where changes to either your HTML files or photographs will trigger an automatic deployment of your entire static website, keeping both parts of your application in sync.
Sources
Tutorial: Create a pipeline that uses Amazon S3 as a deployment provider - AWS CodePipeline
Single source code for different accounts | AWS re:Post

profile picture
answered 2 months ago
AWS
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions