Support for tagging EBS Volumes created by "workers_launch_template*.tf" (#450)

* Added support to tag EBS volumes used by EKS nodes created by workers_launch_template*.tf

* Did terraform fmt on workers_launch_template*.tf
This commit is contained in:
Sergiu Plotnicu
2019-07-30 16:17:49 +03:00
committed by Max Williams
parent e876ce20b9
commit 52286a0065
3 changed files with 31 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
- Output the name of the cloudwatch log group (by @gbooth27)
- Option to use spot instances with launch templates without defining pools, especially useful for GPU instance types (@onur-sam-gtn-ai)
- Added `cpu_credits` param for the workers defined in `worker_groups_launch_template` (by @a-shink)
- Added support for EBS Volumes tag in `worker_groups_launch_template` and `workers_launch_template_mixed.tf` (by @sppwf)
- Write your awesome addition here (by @you)
### Changed

View File

@@ -274,6 +274,21 @@ resource "aws_launch_template" "workers_launch_template" {
}
}
tag_specifications {
resource_type = "volume"
tags = merge(
{
"Name" = "${aws_eks_cluster.this.name}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
)}-eks_asg"
},
var.tags,
)
}
tags = var.tags
lifecycle {

View File

@@ -316,6 +316,21 @@ resource "aws_launch_template" "workers_launch_template_mixed" {
}
}
tag_specifications {
resource_type = "volume"
tags = merge(
{
"Name" = "${aws_eks_cluster.this.name}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
)}-eks_asg"
},
var.tags,
)
}
tags = var.tags
lifecycle {