Open ahmari6 opened 4 years ago
CloudFormation now supports CodeDeploy with ECS.
Hey @ahmari6 š Thank you for taking the time to file this. Given that there's been a number of Terraform and AWS Provider releases since you initially filed it, can you confirm if you're still experiencing this behavior?
@justinretzolk, I can confirm here.
1.0.4
aws_3.48.0
Thank you for confirming @HoussemCharf! I've marked this as a bug so that we can take a look into it as soon as possible.
any updates on this?
@justinretzolk This issue is multiple years old.
Is this on the roadmap at all?
š
This is still an issue with version 5.53.0.
I have this is my aws_ecs_service:
deployment_controller {
type = "CODE_DEPLOY"
}
If I declare task_definition, I get this error:
Error: updating ECS Service (arn:aws:ecs:eu-central-1:REDACTED:service/stage-api/main-api): InvalidParameterException: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment.
If I do not declare task_definition, I get this error:
InvalidParameterException: Family should not be null or empty.
I'll pay someone $100 if they get this bug fixed by June 23rd!
@elijahchancey tbh I forgot this thread but we got it working. Mostly with this article https://medium.com/@ywg/blue-green-deployment-on-aws-ecs-with-terraform-7dfd67502b5b
The thing is after the deployment with terraform you have to initialize codedeploy with aws cli:
export TASK_DEFINITION=\$(aws ecs describe-task-definition \
--task-definition arn:aws:ecs:us-east-1:ACCOUNT:task-definition/SERVICE-${current_env}| jq .taskDefinition.taskDefinitionArn)
envsubst < appspec-template.yaml > appspec-template_rendered.yaml
aws deploy create-deployment --cli-input-yaml file://appspec-template_rendered.yaml
Community Note
Terraform Version
11.14
Affected Resource(s)
Terraform Configuration Files
https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_group.html#blue-green-deployments-with-ecs
Expected Behavior
Terraform should up update task definition value of ECS Service.
Actual Behavior
Error: Error applying plan:
When CODE_DEPLOY deployment controller type is utilized with ECS Service, Terraform fails to perform necessary changes.
This behavior makes the whole ECS BLUE/GREEN deployment impossible when deployed with Terraform.
Steps to Reproduce
References
https://github.com/terraform-providers/terraform-provider-aws/issues/6802
0000