Terraform v0.12.26
Should be able to update ECS Service desired_replicas even when deployment_controller.type is set to CODE_DEPLOY
Error: Error updating ECS Service (arn:aws:ecs:us-east-1:708286315144:service/test/policies-service-v2): InvalidParameterException: Unable to update network parameters on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment.
deployment_controller.type = CODE_DEPLOYdesired_count and attempt to apply changes againnetwork_configuration property, TF included it in the payload to update-service request2020/06/08 04:05:32 [DEBUG] module.ecs.module.policies_service-v2.aws_ecs_service.service: applying the planned Update change
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: 2020/06/08 04:05:32 [DEBUG] Updating ECS Service (arn:aws:ecs:us-east-1:708286315144:service/test/policies-service-v2): {
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: Cluster: "arn:aws:ecs:us-east-1:708286315144:cluster/test",
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: DesiredCount: 0,
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: ForceNewDeployment: false,
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: NetworkConfiguration: {
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: AwsvpcConfiguration: {
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: AssignPublicIp: "DISABLED",
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: SecurityGroups: ["sg-02848434002f782f9"],
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: Subnets: ["subnet-014f47760b389f8db","subnet-03cdd43d8265511be","subnet-0f67bb732709250c6"]
2020-06-08T04:05:32.935Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: }
2020-06-08T04:05:32.936Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: },
2020-06-08T04:05:32.936Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: Service: "arn:aws:ecs:us-east-1:708286315144:service/test/policies-service-v2"
2020-06-08T04:05:32.936Z [DEBUG] plugin.terraform-provider-aws_v2.65.0_x4: }
network_configurationdesired_count and can by reproduced by making changes to task_placement_constaints tooFor services using the blue/green (CODE_DEPLOY ) deployment controller, only the desired count, deployment configuration, task placement constraints and strategies, and health check grace period can be updated using this API. If the network configuration, platform version, or task definition need to be updated, a new AWS CodeDeploy deployment should be created. For more information, see CreateDeployment in the AWS CodeDeploy API Reference .
I encountered the same problem. Including network_configuration as ignore_changes doesn't work - network_configuration change doesn't appear in the diff view, but it is included in the API call request when apply.
Looking into the debug log, I found the order of the subnets in the update request is different from the value of the current state.
{"awsvpcConfiguration":{"assignPublicIp":"ENABLED","securityGroups":["sg-09b7377097c0c97fd"],"subnets":["subnet-012c6b3edd7abd4d9","subnet-0f5c632fc7e9db0ab","subnet-041643c250580e1dc"]}}
{"awsvpcConfiguration":{"assignPublicIp":"ENABLED","securityGroups":["sg-09b7377097c0c97fd"],"subnets":["subnet-041643c250580e1dc","subnet-012c6b3edd7abd4d9","subnet-0f5c632fc7e9db0ab"]}}
The attribute type of subnets is TypeSet, so the two values should be the same.
However, it seems d.hasChange("network_configuration") returns true somehow since the request includes the networkConfiguration attribute.
I'm not familiar with the codebase so I might look at unrelated place though.
I'm having the same issue, trying to add tags to a service.
In the plan only appears the tags being changed.
During the apply I get this error: "InvalidParameterException: Unable to update network parameters on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment."
Including network_configuration as ignore_changes is not helping.
Having the same issues while trying to update the desired count of tasks, any updates on this?
Having the same issue when trying to update the platform version.
Most helpful comment
Having the same issues while trying to update the desired count of tasks, any updates on this?