CodeDeploy to update Auto scaling launch template

0

Hi, Is this possible to update the auto scaling group launch template with new code built with aws code build and I need to deploy that new code via codedeploy to a launch instance. Here I already had the auto scaling group and launch template. I need a example Cloud formation script to build the above solution

Tharun
已提問 5 個月前檢視次數 185 次
2 個答案
1

Hello.

Why not just deploy the code directly to EC2 in the AutoScaling group instead of updating the launch template?
https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-groups-create-blue-green.html

Blue/Green deployment of AutoScaling groups is not supported by CloudFormation, so you will need to create Lambda etc. as shown in the blog below.
https://medium.com/@greeshu.renu/blue-green-deployment-using-aws-cloudformation-bd936dc0fe01

profile picture
專家
已回答 5 個月前
  • Thank you for the reply, Reason not to deploy directly to EC2 auto scaling group is if one instance goes down the ASG will bring up new instance with older launch template.

0

Hello,

I'm no expert, but I think all you have to do is rename your CodeDeploy.

CloudFormation will create a new CodeDeploy for you by keeping resources that are currently in use. Of course, make sure you don't rename your other resources.

For exemple, if tou have this code:

MyDeploy: 
  Type: AWS::CodeDeploy::Application 
  Properties:
    ComputePlatform: Lambda

You can do that:

MyDeploy2: 
  Type: AWS::CodeDeploy::Application 
  Properties:
    ComputePlatform: Lambda

Please don't rename other ressources because CloudFormation will destroy and create new ones.

@Riku_Kobayashi Can you tell me if I'm wrong or not? (It's my first comment on re:Post)

seikida
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南