mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 08:37:18 +01:00
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:
committed by
GitHub
parent
c54ce911dc
commit
c75fbb0164
@@ -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" {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user