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

worker LT lifecycle problem #939

Closed
1 of 4 tasks
jurgenweber opened this issue Jul 3, 2020 · 10 comments
Closed
1 of 4 tasks

worker LT lifecycle problem #939

jurgenweber opened this issue Jul 3, 2020 · 10 comments

Comments

@jurgenweber
Copy link
Contributor

jurgenweber commented Jul 3, 2020

I have issues

Terraform v0.13.0-beta3
+ provider registry.terraform.io/hashicorp/aws v2.69.0
+ provider registry.terraform.io/hashicorp/helm v1.2.3
+ provider registry.terraform.io/hashicorp/kubernetes v1.11.3
+ provider registry.terraform.io/hashicorp/local v1.4.0
+ provider registry.terraform.io/hashicorp/null v2.1.2
+ provider registry.terraform.io/hashicorp/random v2.2.1
+ provider registry.terraform.io/hashicorp/template v2.1.2
+ provider registry.terraform.io/hashicorp/tfe v0.19.0

I do not know if this is a tf v0.13 only issue or not.

I'm submitting a...

  • bug report
  • feature request
  • support request - read the FAQ first!
  • kudos, thank you, warm fuzzy

What is the current behaviour?

When changing a value in the worker_groups_launch_template, I received the following error:

When expanding the plan for
module.cluster["0"].module.eks.random_pet.workers_launch_template[1] to
include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/random" changed the planned action from
CreateThenDelete to DeleteThenCreate.

It seems even thought I have asg_recreate_on_change set to the default (false), random_pet still generates a new name. This is based on the fact that changing a value in the launch_template creates a new revision and the lt_name changes:

      ~ id        = "needed-basilisk" -> (known after apply)
      ~ keepers   = { # forces replacement
          ~ "lt_name" = "operational-aws-mem-spot-subnet-0a8c56b2b9b261fb020200625034031068900000012-1" -> "operational-aws-mem-spot-subnet-0a8c56b2b9b261fb020200625034031068900000012-5"
        }
        length    = 2
        separator = "-"
    }

If this is a bug, how to reproduce? Please include a code sample if relevant.

Change a value in the worker_groups_launch_template.

What's the expected behavior?

No error, the random_pet function either completes its task or does not run with 'asg_recreate_on_change' is false.

Are you able to fix this problem and submit a PR?

fix here: #940

Environment details

  • Affected module version: I tried 0.12.1 and master.
  • OS: Unix
  • Terraform version: 0.13.0beta2 and beta3

Any other relevant info

@dpiddockcmp
Copy link
Contributor

I'm a little wary of implementing changes for beta versions of Terraform before they have announced or confirmed that this is an expected behaviour change and not a regression. It looks like it could be related to this issue hashicorp/terraform#25016 but it's more of a design spec than a fixed implementation.

@jurgenweber
Copy link
Contributor Author

yeah, sure... I gave it a go with RC1 and the problem still exists.

@ramirezag
Copy link

ramirezag commented Aug 4, 2020

Using Terraform 13 rc, we also encounter this same issue

Error: Provider produced inconsistent final plan

When expanding the plan for
module.xxx_eks.module.eks.random_pet.workers_launch_template[0] to
include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/random" changed the planned action from
CreateThenDelete to DeleteThenCreate.

@jurgenweber
Copy link
Contributor Author

@dpiddockcmp v13 is GA now, wdyt?

@dpiddockcmp
Copy link
Contributor

This must be a regression somewhere in Terraform that is triggered by the complexity of logic in this module. The issue does not appear to happen for the launch config workers which also makes use of the random_pet. Given that 0.13 is now GA I'll merge the simple fix.

@dpiddockcmp
Copy link
Contributor

Fixed via #940

@jurgenweber
Copy link
Contributor Author

I noticed this today; https://github.com/hashicorp/terraform/releases/tag/v0.13.3

So it seems tf v.013 also had some problems with the lifecyele block

@jeffreymlewis
Copy link

Just ran into this issue, and can confirm that terraform 0.13.4 fixed this problem (for me) as @jurgenweber suspected.

@Snehil03
Copy link

Snehil03 commented Feb 12, 2021

I ran with same issue while running terraform apply ,
created new github issue mentioned below, any pointers would help.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants