From 07392c7451e6c85d357160e0ea5ea1e3e6242990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20W?= Date: Fri, 14 Aug 2020 23:23:17 +1000 Subject: [PATCH] fix: random_pet with LT workers under 0.13.0 (#940) Fix for: Error: Provider produced inconsistent final plan When expanding the plan for 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. --- .gitignore | 1 + workers_launch_template.tf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 6b31084d05a..db3aec7ca3c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ eks-admin-service-account.yaml *.iml config-map-aws-auth*.yaml kubeconfig_* +*.swp diff --git a/workers_launch_template.tf b/workers_launch_template.tf index eaf734b41f4..5c328c5d3e5 100644 --- a/workers_launch_template.tf +++ b/workers_launch_template.tf @@ -476,6 +476,9 @@ resource "random_pet" "workers_launch_template" { ) ) } + lifecycle { + create_before_destroy = true + } } resource "aws_iam_instance_profile" "workers_launch_template" {