Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_changes used w/ aws_ecs_service causes "diffs didn't match" #4953

Closed
anosulchik opened this issue Feb 2, 2016 · 2 comments
Closed

Comments

@anosulchik
Copy link

Please refer #4950 I cannot reopen it so I've created new issue.


Looks like it still doesn't works as expected. Here's how to reproduce:

  1. create ecs service with ignore_changes enabled for desired_count:
resource "aws_ecs_service" "issues_ecs_service" {
  name = "issues_${var.environment_name}"
  cluster = "${aws_ecs_cluster.cluster1.id}"
  task_definition = "${aws_ecs_task_definition.issues_task_def.arn}"
  desired_count = 2
  iam_role = "${var.ecs_service_role_arn}"

  load_balancer {
    elb_name = "${aws_elb.issues_service_elb.id}"
    container_name = "issues"
    container_port = 8443
  }

  lifecycle {
    ignore_changes = [ "desired_count" ]
  }
}
  1. Change ecs desired count via ECS console or API call (we're doing it via AWS lambda).
  2. Try to apply changes into ecs service e.g. set new task definition for it.

Here's the log:

2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalIf
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalInterpolate
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalGetProvider
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalReadState
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalDiff
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalReadDiff
2016/02/02 16:34:57 [DEBUG] root: eval: *terraform.EvalCompareDiff
2016/02/02 16:34:57 [ERROR] aws_ecs_service.issues_ecs_service: diffs didn't match
2016/02/02 16:34:57 [ERROR] aws_ecs_service.issues_ecs_service: reason: extra attributes: desired_count
2016/02/02 16:34:57 [ERROR] aws_ecs_service.issues_ecs_service: diff one: *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{"task_definition":*terraform.ResourceAttrDiff{Old:"arn:aws:ecs:us-east-1:xxx:task-definition/issues_service_Staging:25", New:"arn:aws:ecs:us-east-1:xxx:task-definition/issues_service_Staging:26", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
2016/02/02 16:34:57 [ERROR] aws_ecs_service.issues_ecs_service: diff two: *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{"task_definition":*terraform.ResourceAttrDiff{Old:"arn:aws:ecs:us-east-1:xxx:task-definition/issues_service_Staging:25", New:"arn:aws:ecs:us-east-1:xxx:task-definition/issues_service_Staging:26", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "desired_count":*terraform.ResourceAttrDiff{Old:"4", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
2016/02/02 16:34:57 [ERROR] root: eval: *terraform.EvalCompareDiff, err: aws_ecs_service.issues_ecs_service: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2016/02/02 16:34:57 [ERROR] root: eval: *terraform.EvalSequence, err: aws_ecs_service.issues_ecs_service: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2016/02/02 16:34:57 [ERROR] root: eval: *terraform.EvalOpFilter, err: aws_ecs_service.issues_ecs_service: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2016/02/02 16:34:57 [ERROR] root: eval: *terraform.EvalSequence, err: aws_ecs_service.issues_ecs_service: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2016/02/02 16:34:57 [INFO] Exiting eval tree: aws_ecs_service.issues_ecs_service
2016/02/02 16:34:57 [DEBUG] vertex provider.aws (close), got dep: aws_ecs_service.issues_ecs_service
2016/02/02 16:34:57 [DEBUG] vertex root, got dep: provider.aws (close)
2016/02/02 16:34:57 [DEBUG] vertex root, got dep: provisioner.chef
2016/02/02 16:34:57 [DEBUG] vertex root, got dep: var.iam_instance_profile
2016/02/02 16:34:57 [DEBUG] vertex root, got dep: provisioner.file
2016/02/02 16:34:57 [DEBUG] vertex root, got dep: var.availability_zones

'terraform apply' starts working again without issues as soon as I return desired count to initial value (2).

Please let me know if there any options to resolve it. Thank you!

@radeksimko radeksimko changed the title ignore_changes doesn't work as expected for aws_ecs_service resource ignore_changes used w/ aws_ecs_service causes "diffs didn't match" Mar 3, 2016
@phinze
Copy link
Contributor

phinze commented Mar 14, 2016

Hi @anosulchik - thanks for this report, I'm diving into ignore_changes fixes today and consolidating the effort in #5627

@phinze phinze closed this as completed Mar 14, 2016
@ghost
Copy link

ghost commented Apr 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants