更新托管在AWS S3存储桶上的静态网站 [英] Updating a static website hosted on an AWS S3 Bucket
问题描述
我需要一种更好的方法来更新托管在AWS S3存储桶中的静态网站.
I need a better way to update a static website that is hosted in an AWS S3 bucket.
每当我要更新通过S3存储桶托管的个人站点时,都必须从S3存储桶中删除index.html文件和资产文件夹,然后重新上传新文件.我正在通过AWS Web界面执行此操作.是否可以使用类似于git的方式来使用其他AWS服务来执行此操作,以便我可以推送更新的代码?可能是lambda吗?
Whenever I am wanting to update my personal site that I have hosted through a S3 bucket, I have to deleting the index.html file and the assets folder from the S3 bucket, then re-upload the new files. I am doing this through the AWS web interface. Is there a way to use a different AWS service to do this in a way similar to git where I can push updated code? Possibly with lambda?
推荐答案
您无法使用持续集成和部署"来自动化整个过程.最简单形式的架构如下所示:
You cant automate the whole process using Continous Integration and Deployment. The architecture in the simplest form looks like this :
- 设置AWS Code Pipeline以在存储库中的任何新代码提交(github,bitbucket等)上触发lambda函数
- lambda可以完成更新S3内容的任务
可以在 https://github.com上引用更复杂的体系结构/alestic/aws-git-backed-static-website .这是来自同一来源的架构
A more sophisticated architecture can be referred at https://github.com/alestic/aws-git-backed-static-website. Here is the architecture sourced from the same source
这篇关于更新托管在AWS S3存储桶上的静态网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!