fix: Fix cycle error during the destroy phase when we change workers order (#1043)

NOTES: Keep in mind that changing the order of workers group is a destructive operation. All workers group are destroyed and recreated. If you want to do this safely, you should move then in state with `terraform state mv` until we manage workers groups as maps.
This commit is contained in:
Thierno IB. BARRY
2020-10-12 21:50:22 +02:00
committed by GitHub
parent c54ce911dc
commit c75fbb0164
2 changed files with 13 additions and 0 deletions

View File

@@ -295,6 +295,10 @@ resource "random_pet" "workers" {
keepers = {
lc_name = aws_launch_configuration.workers[count.index].name
}
lifecycle {
create_before_destroy = true
}
}
resource "aws_security_group" "workers" {
@@ -409,6 +413,10 @@ resource "aws_iam_instance_profile" "workers" {
)
path = var.iam_path
lifecycle {
create_before_destroy = true
}
}
resource "aws_iam_role_policy_attachment" "workers_AmazonEKSWorkerNodePolicy" {

View File

@@ -492,6 +492,7 @@ resource "random_pet" "workers_launch_template" {
)
)
}
lifecycle {
create_before_destroy = true
}
@@ -506,4 +507,8 @@ resource "aws_iam_instance_profile" "workers_launch_template" {
local.default_iam_role_id,
)
path = var.iam_path
lifecycle {
create_before_destroy = true
}
}