Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Launch Template ASGs pin to created version #1289

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ locals {
root_block_device_name = data.aws_ami.eks_worker.root_device_name # Root device name for workers. If non is provided, will assume default AMI was used.
root_kms_key_id = "" # The KMS key to use when encrypting the root storage device
launch_template_id = null # The id of the launch template used for managed node_groups
launch_template_version = "$Latest" # The lastest version of the launch template to use in the autoscaling group
launch_template_version = "$Created" # The created version of the launch template to use in the autoscaling group
launch_template_placement_tenancy = "default" # The placement tenancy for instances
launch_template_placement_group = null # The name of the placement group into which to launch the instances, if any.
root_encrypted = false # Whether the volume should be encrypted or not
Expand Down
4 changes: 4 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ resource "aws_autoscaling_group" "workers_launch_template" {
version = lookup(
var.worker_groups_launch_template[count.index],
"launch_template_version",
local.workers_group_defaults["launch_template_version"] == "$Created" ?
aws_launch_template.workers_launch_template.*.latest_version[count.index] :
local.workers_group_defaults["launch_template_version"],
)
}
Expand Down Expand Up @@ -171,6 +173,8 @@ resource "aws_autoscaling_group" "workers_launch_template" {
version = lookup(
var.worker_groups_launch_template[count.index],
"launch_template_version",
local.workers_group_defaults["launch_template_version"] == "$Created" ?
aws_launch_template.workers_launch_template.*.latest_version[count.index] :
local.workers_group_defaults["launch_template_version"],
)
}
Expand Down