CodeDeploy and Instance Refresh in Auto Scaling Group

0

Hi! Does CodeDeploy work with Instance Refresh in Auto Scaling Group? Will CodeDeploy automatically deploy the updated application version after uploading a new AMI and performing a refresh?

I'm wondering how to automate this process if I'm creating an AMI in Packer and updating the launch template using Terraform, while the application is being deployed through CodeDeploy

1 回答
2
已接受的回答

Yes, CodeDeploy can work with Instance Refresh in an Auto Scaling Group (ASG).

To automate this process, you would need to configure CodeDeploy to use a deployment group that targets the instances in your ASG. You can specify deployment rules, deployment configurations, and the updated application version to deploy.

In your case, where you are creating the AMI with Packer and updating the launch template using Terraform, you would follow these steps:

  • Use Packer to create a new AMI with the updated application version.
  • Update the launch template in Terraform with the new AMI ID.
  • Trigger an Instance Refresh in the ASG, which will replace the instances with new instances created from the updated AMI.
  • Configure CodeDeploy to deploy the updated application version to the new instances in the ASG.
  • CodeDeploy will recognize the newly launched instances and automatically initiate the deployment process.
profile picture
专家
已回答 1 年前
profile picture
专家
已审核 6 个月前
  • Thanks for the reply, everything is correct and works fine!

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则