amazon-web-services - S3静态网站/蓝绿部署

标签 amazon-web-services amazon-s3 amazon-cloudfront blue-green-deployment

我很难为我的 s3 静态网站提供蓝绿色。我在给定的存储桶中发布了该网站的一个版本,并在以下位置公开:

  • Cloudfront 发行版
  • 然后在 53 号公路
  • 和另一个 CDN(公司,解析 DNS)以访问互联网。

  • 我尝试了一些“计算”解决方案,比如 ALB,但我没有成功。

    我遇到的困难的主要问题是,当我使用新地址更新 CloudFront 时,DNS 复制时间很长,这使得将 future 版本回滚到旧版本变得困难(考虑为此发布使用不同的存储桶)。

    有没有人经历过这个或知道如何解决这个问题?

    最佳答案

    AWS 建议您为每个创建不同的 CloudFront 分配
    蓝/绿变体,每个都有自己的 DNS。
    来自 Hosting Static Websites on AWS规范性指导:

    Different CloudFront distributions can point to the same Amazon S3 bucket so there is no need to have multiple S3 buckets. Each variation [A/B or blue/green] would store its assets under different folders in the same S3 bucket. Configure the CloudFront behaviors to point to the respective Amazon S3 folders for each A/B or blue/green variation.

    The other key part of this strategy is an Amazon Route 53 feature called weighted routing. Weighted routing allows you to associate multiple resources with a single DNS name and dynamically resolve DNS based on their relative assigned weights. So if you want to split your traffic 70/30 for an A/B test, set the relative weights to be 70 and 30. For blue/green deployments, an automation script can call the Amazon Route 53 API to gradually shift the relative weights from blue to green after automated tests validate that the green version is healthy.

    关于amazon-web-services - S3静态网站/蓝绿部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60030262/

    相关文章:

    Django 亚马逊 s3 可疑操作

    express - API GW Lambda 代理集成 CORS 问题

    amazon-web-services - CloudFormation 中的 AWS::CloudFront::OriginRequestPolicy 资源

    防止注入(inject)的 C# 字符串参数?

    amazon-web-services - 如何从 Azure DevOps 连接 Amazon RDS SQL 以实现数据库自动化

    amazon-web-services - 如何处理重叠的后缀,s3 事件通知的前缀

    c# - 在 C# 桌面应用程序中存储我的 Amazon 凭据

    mysql - 无法在 AWS-mysql 中创建表并抛出错误代码 1044。拒绝用户 'user1' @'%' 访问数据库 'mysqlDB'

    amazon-web-services - Terraform 不会删除启用了缩减保护的自动缩放组

    ios - 是否无法使用 AWS CloudFront 在 S3 上下载我的私有(private)镜像?