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

[Bug]: When expanding the plan for aws_ecs_service.qa-ecs-service [...] provider aws produced an invalid new value for .triggers["redeployment"]: was cty.StringVal("2022-11-28T16:50:44Z"), but now │ cty.StringVal("2022-11-28T18:08:03Z"). #28070

Open
domvo opened this issue Nov 29, 2022 · 10 comments
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service.

Comments

@domvo
Copy link

domvo commented Nov 29, 2022

Terraform Core Version

v1.3.5

AWS Provider Version

v4.41.0

Affected Resource(s)

  • aws_ecs_service

Expected Behavior

Running apply multiple times with an aws_ecs_service that has force_new_deployment set to true should run a new deployment of the given ecs Service.

Actual Behavior

It shows an error and doesn't run apply (or when it applies, it doesn't do anything, because it says "No Changes").

Relevant Error/Panic Output Snippet

| Error: Provider produced inconsistent final plan
│
│ When expanding the plan for aws_ecs_service.qa-ecs-service to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for .triggers["redeployment"]: was cty.StringVal("2022-11-28T16:50:44Z"), but now
│ cty.StringVal("2022-11-28T18:08:03Z").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform Configuration Files

resource "aws_ecs_service" "qa-ecs-service" {
  name            = "qa-${var.pr_id}-ecs-service"
  cluster         = var.cluster_arn
  task_definition = aws_ecs_task_definition.qa-task-definition.arn
  desired_count   = 1
  launch_type     = "FARGATE"
  network_configuration {
    subnets       = var.subnets
    security_groups = var.security_groups
    assign_public_ip = true 
  }
  load_balancer {
    target_group_arn  = aws_lb_target_group.qa-target-group.arn
    container_name    = "qa-${var.pr_id}-container"
    container_port    = "8080"
  }
  force_new_deployment = true

  triggers = {
    redeployment = timestamp()
  }
}

Steps to Reproduce

  • terraform apply
  • terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

@domvo domvo added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Nov 29, 2022
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/ecs Issues and PRs that pertain to the ecs service. label Nov 29, 2022
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Nov 29, 2022
@rnithinpaladin
Copy link

same issue

@simon-turnbull-healx
Copy link

Same issue as well using Terraform v1.3.6 with hashicorp/aws v4.50.0

When expanding the plan for module.xyz.aws_ecs_service.service to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for .triggers["redeployment"]: was cty.StringVal("2023-01-19T09:58:45Z"), but now cty.StringVal("2023-01-19T12:58:17Z").

│ This is a bug in the provider, which should be reported in the provider's own issue tracker

@mshanks1983
Copy link

Any updates on this yet? It's proving to be a pretty big blocker for some of my deployment efforts.

@mshanks1983
Copy link

mshanks1983 commented Mar 1, 2023

Would it reduce the likelihood of hitting this bug if I used something like date() instead of time()? Something that doesn't change with the time as quickly?

@nathanhruby
Copy link

Did you try using true instead of timestamp()?

@scheleaap
Copy link

This is likely a duplicate of #19583.

@lordz-ei
Copy link

lordz-ei commented Nov 1, 2023

Did you try using true instead of timestamp()?

I assume you mean
triggers = { redeployment = true }

@lordz-ei
Copy link

lordz-ei commented Nov 9, 2023

@nathanhruby, setting
triggers = { redeployment = true }
does not have any efect in my case

@Surgo
Copy link

Surgo commented Nov 23, 2023

It's works fine for me.

  triggers = {
    redeployment = plantimestamp()
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
Development

No branches or pull requests

9 participants