Terraform-aws-eks: worker LT lifecycle problem

Created on 3 Jul 2020  路  8Comments  路  Source: terraform-aws-modules/terraform-aws-eks

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...

  • [x] 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:
+/- resource "random_pet" "workers_launch_template" { ~ 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: https://github.com/terraform-aws-modules/terraform-aws-eks/pull/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

Most helpful comment

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

All 8 comments

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 https://github.com/hashicorp/terraform/issues/25016 but it's more of a design spec than a fixed implementation.

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

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.

@dpiddockcmp v13 is GA now, wdyt?

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.

Fixed via #940

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

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

Was this page helpful?
0 / 5 - 0 ratings