如何使用boto3更新云方事件以触发lambda

发布于 2025-02-06 14:47:57 字数 290 浏览 2 评论 0原文

我们的目标是允许在S3中托管并通过CloudFront服务的维护模式或主要网站之间进行切换。

我们已经尝试使用lambda@edge返回HTML并通过CloudFront Events viever request触发它

,但现在可以通过控制台更新CloudFront Distribution, 我们要更新它使用CLI(BOTO3) 。我已经阅读了BOTO3文档,找不到如何实施它。是否可以通过BOTO3更新CloudFront事件,还是有其他解决方案?

Our goal is to allow switching between maintenance mode or main website that hosted in s3 and served through CloudFront.

We have tried using lambda@edge to return html and trigger it via CloudFront events viewer request

It's works fine, but now instead of updating CloudFront distribution via console, we want to update it using CLI (boto3). I have read boto3 documentation and can't find how to implement it. Is it possible to update CloudFront events via boto3, or is there another solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城缀染半城烟沙 2025-02-13 14:47:57

Yes, you use update_distribution which allows you to specify LambdaFunctionAssociations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文