gpt4 book ai didi

amazon-web-services - 适用于 EC2 的 AWS CloudFormation 蓝/绿部署

转载 作者:行者123 更新时间:2023-12-03 07:20:08 25 4
gpt4 key购买 nike

AWS CloudFormation 是否支持 EC2 的蓝/绿部署?我能够使用 CodeDeploy for EC2 创建蓝/绿部署;但是,我不知道如何使用 CloudFormation 创建一个。 CloudFormation 似乎支持 ECS ( https://aws.amazon.com/about-aws/whats-new/2020/05/aws-cloudformation-now-supports-blue-green-deployments-for-amazon-ecs/ ) 和 Lambda 函数的蓝/绿部署。

模板的 CodeDeploy 部分如下所示:

Type: AWS::CodeDeploy::DeploymentGroup
Properties:
DeploymentGroupName: 'SampleGroupName'
ServiceRoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/AzureDevOps/CodeDeployOperations'
ApplicationName: !Ref CodeDeployApplication
AutoScalingGroups:
- !Ref SampleASG
DeploymentStyle:
DeploymentType: BLUE_GREEN
DeploymentOption: WITH_TRAFFIC_CONTROL
BlueGreenDeploymentConfiguration:
TerminateBlueInstancesOnDeploymentSuccess:
Action: TERMINATE
TerminationWaitTimeInMinutes: 5
DeploymentReadyOption:
ActionOnTimeout: CONTINUE_DEPLOYMENT
GreenFleetProvisioningOption:
Action: COPY_AUTO_SCALING_GROUP
DeploymentConfigName: !If [IsProdStaging, CodeDeployDefault.HalfAtATime, CodeDeployDefault.AllAtOnce]
LoadBalancerInfo:
TargetGroupInfoList:
- Name: !GetAtt SampleTargetGroup.TargetGroupName
AutoRollbackConfiguration:
Enabled: true
Events:
- DEPLOYMENT_FAILURE

最佳答案

截至目前(2021 年 10 月),如果您使用 EC2,AWS 仍然不支持通过 CloudFormation 进行蓝/绿部署。 DeploymentStyle section of the docs 中有一个蓝色注释,阅读:

For blue/green deployments, AWS CloudFormation supports deployments onLambda compute platforms only. You can perform Amazon ECS blue/greendeployments using AWS::CodeDeploy::BlueGreen hook.

令人非常沮丧的是,此功能不可用,因为没有好的解决方法。

关于amazon-web-services - 适用于 EC2 的 AWS CloudFormation 蓝/绿部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68262855/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com