I want to use the following code block to deploy the ecs service task per apply, even if my image is still an old version, and the force_new_deployment
will help me mandatory to update it. But in my test, I found that it doesn’t.
resource "aws_ecs_service" "this" {
name = local.service_name
cluster = var.cluster_arn
task_definition = aws_ecs_task_definition.this.arn
desired_count = var.desired_count
launch_type = "FARGATE"
platform_version = var.platform_version
force_new_deployment = true
health_check_grace_period_seconds = var.health_check_grace_period_seconds
tags = var.tags
network_configuration {
security_groups = var.security_groups
subnets = var.subnets
}
}
when I use the aws cli, It can mandatory update.
aws ecs update-service --cluster ${clusterName} --service ${serverName} --platform-version ${platformVersion} --force-new-deployment --region ${region}
anyone know why cause it?