mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-21 17:09:04 +01:00
feat: Drop asg_recreate_on_change feature to encourage the usage of Instance Refresh for EC2 Auto Scaling (#1360)
BREAKING CHANGES: This module used `random_pet` resources to create a random name for the autoscaling group to force the autoscaling group to be re-created when the launch configuration or launch template was changed (if `recreate_asg_when_lc_changes = true` was set), causing the instances to be removed and re-provisioned each time there was an update. Those random_pet resources has been removed and in its place there is now a set of functionality provided by AWS and the Terraform AWS provider - Instance Refresh. We encourage those users to move on Instance Refresh for EC2 Auto Scaling.
This commit is contained in:
committed by
GitHub
parent
19e6be9df3
commit
32f70afe60
18
workers.tf
18
workers.tf
@@ -7,8 +7,7 @@ resource "aws_autoscaling_group" "workers" {
|
||||
compact(
|
||||
[
|
||||
coalescelist(aws_eks_cluster.this[*].name, [""])[0],
|
||||
lookup(var.worker_groups[count.index], "name", count.index),
|
||||
lookup(var.worker_groups[count.index], "asg_recreate_on_change", local.workers_group_defaults["asg_recreate_on_change"]) ? random_pet.workers[count.index].id : ""
|
||||
lookup(var.worker_groups[count.index], "name", count.index)
|
||||
]
|
||||
)
|
||||
)
|
||||
@@ -326,21 +325,6 @@ resource "aws_launch_configuration" "workers" {
|
||||
]
|
||||
}
|
||||
|
||||
resource "random_pet" "workers" {
|
||||
count = var.create_eks ? local.worker_group_count : 0
|
||||
|
||||
separator = "-"
|
||||
length = 2
|
||||
|
||||
keepers = {
|
||||
lc_name = aws_launch_configuration.workers[count.index].name
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_security_group" "workers" {
|
||||
count = var.worker_create_security_group && var.create_eks ? 1 : 0
|
||||
name_prefix = var.cluster_name
|
||||
|
||||
Reference in New Issue
Block a user