Skip to content

Instantly share code, notes, and snippets.

@samof76
Created August 7, 2020 03:53
Show Gist options
  • Save samof76/ecb67012f8fe1124ba2de6263599ddad to your computer and use it in GitHub Desktop.
Save samof76/ecb67012f8fe1124ba2de6263599ddad to your computer and use it in GitHub Desktop.
06_autoscaling.tf
resource "aws_autoscaling_group" "eks_nodes_asg" {
count = length(var.vpc_zone_identifier)
desired_capacity = var.nodes_desired_capacity
launch_configuration = aws_launch_configuration.eks_nodes_lc.id
max_size = var.nodes_max_size
min_size = var.nodes_min_size
name = "${var.cluster_name}-node-asg-${count.index}"
vpc_zone_identifier = [var.vpc_zone_identifier[count.index]]
termination_policies = var.termination_policies
tags = module.node_label.tags_as_list_of_maps
lifecycle {
create_before_destroy = true
ignore_changes = [
desired_capacity,
vpc_zone_identifier,
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment