Updating a static website deployed to Amplify from an S3 bucket
If you update any of the objects for a static website in general purpose S3 bucket hosted on Amplify, you must redeploy the application to Amplify Hosting to cause the changes to take effect. Amplify Hosting doesn't automatically detect changes to the S3 bucket. We recommend that you use the AWS Command Line Interface (CLI) to update your website.
Sync updates to S3
After you make changes to your website's project files, use the following s3 sync<source>
with the name of your local directory and
<target>
with the name of your Amazon S3 bucket.
aws s3 sync
<source>
<target>
Redeploy the website to Amplify Hosting
Use the following amplify start-deployment<app_id>
with the id of your Amplify application,
<branch_name>
with the name of your branch, and
s3://amzn-s3-demo-website-bucket/prefix
with your
S3 bucket and prefix. .
aws amplify start-deployment --app-id
<app_id>
--branch-name<branch_name>
--source-urls3://amzn-s3-demo-website-bucket/prefix
--source-url-type BUCKET_PREFIX