Search code examples
amazon-web-servicesaws-code-deployelastic-load-balancer

CodeDeploy Blue/Green Deployment AUTO_SCALING_CONFIGURATION Failure


Trying to get an automatic Blue/Green deployment going on AWS. When I run the deployment I get:

The deployment failed because a non-empty field was discovered on your Auto Scaling group that Code Deploy does not currently support copying. Unsupported fields: 
[DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.Instances.member.LaunchTemplate.Version, 
DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.LaunchTemplate.LaunchTemplateName, 
DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.LaunchTemplate.LaunchTemplateId, 
DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.LaunchTemplate.Version, 
DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.Instances.member.LaunchTemplate.LaunchTemplateName, 
DescribeAutoScalingGroupsResponse.DescribeAutoScalingGroupsResult.AutoScalingGroups.member.Instances.member.LaunchTemplate.LaunchTemplateId] 
(Error code: AUTO_SCALING_CONFIGURATION)

From reading here it sounds like it's because CodeDeploy hasn't been updated to use the latest stuff from the Auto-Scaling side.

Unfortunately, this is an issue that customers will likely continue facing. When doing a blue/green deployment where we copy your ASG, we have to copy all of that configuration, which requires CodeDeploy to know about any new attributes that ASG supports. As such, there is a lag.

Is that right or am I doing something wrong? Is someone from AWS able to confirm that?


Solution

  • I would try CloudFromation, and not use LaunchTemplates, which are not currently supported in CodeDeploy. LaunchTemplates are new and are used to capture launch settings in the AWS console.

    Try using the AWS::AutoScaling::LaunchConfiguration resource in CFN instead.

    See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html

    Update: The AWS DevOps team published a solution on their blog for Performing Blue/Green Deployments with AWS CodeDeploy and Auto Scaling Groups.

    It made the process much more clear to us a After reviewing the solution templates, we are now doing blue/green deployments in production - and had been doing in-place deployments for years. This is a much better way to deploy for a lot of use cases.