I'm trying to create a deployment group for an AWS ECS deployment
I'm following the instruction that I found here: https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-groups-create-ecs.html
The only issue is the example is done through the console and I'd prefer to do it either with Cloudformation or the CLI.
So, I decided to create my template. This is my AWS::CodeDeploy::DeploymentGroup
CDDeploymentGroup:
Type: AWS::CodeDeploy::DeploymentGroup
Properties:
ApplicationName:
Ref: CDApp
DeploymentConfigName: CodeDeployDefault.LambdaCanary10Percent5Minutes
DeploymentStyle:
DeploymentType: BLUE_GREEN
DeploymentOption: WITH_TRAFFIC_CONTROL
LoadBalancerInfo:
ElbInfoList:
- Name: !Ref LoadBalancer
TargetGroupPairInfoList:
- ProdTrafficRoute:
ListenerArns:
- !Ref LoadBalancerListener1
- TestTrafficRoute:
ListenerArns:
- !Ref LoadBalancerListener1
TargetGroupInfoList:
- Name: !Ref LoadBalancerTG1
- Name: !RefLoadBalancerTG2
ServiceRoleArn:
Fn::GetAtt: [ CodeDeployRole, Arn ]
When I deploy this template, Cloudformation fails with the following error:
my-cluster UPDATE_ROLLBACK_IN_PROGRESS. The following resource(s) failed to create: [CDDeploymentGroup, Service2].
Service2 CREATE_FAILED. Resource creation cancelled
CDDeploymentGroup CREATE_FAILED Property LoadBalancerInfo cannot be specified.
I searched for this error and I found that CodeDeploy in Cloudformation only supports Blue/Green deployments for Lambda.
However, I was able to follow the previous document and make it work through the console. If I can make it work using the console I should be able to make it work at least with the cli, correct?
How can I set up the Deployment Group using Cloudformation or the CLI?
This is turning me crazy.
Thanks.