Skip to content

Commit 52286a0

Browse files
sppwfmax-rocket-internet
authored andcommitted
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
1 parent e876ce2 commit 52286a0

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1515
- Output the name of the cloudwatch log group (by @gbooth27)
1616
- Option to use spot instances with launch templates without defining pools, especially useful for GPU instance types (@onur-sam-gtn-ai)
1717
- Added `cpu_credits` param for the workers defined in `worker_groups_launch_template` (by @a-shink)
18+
- Added support for EBS Volumes tag in `worker_groups_launch_template` and `workers_launch_template_mixed.tf` (by @sppwf)
1819
- Write your awesome addition here (by @you)
1920

2021
### Changed

workers_launch_template.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,21 @@ resource "aws_launch_template" "workers_launch_template" {
274274
}
275275
}
276276

277+
tag_specifications {
278+
resource_type = "volume"
279+
280+
tags = merge(
281+
{
282+
"Name" = "${aws_eks_cluster.this.name}-${lookup(
283+
var.worker_groups_launch_template[count.index],
284+
"name",
285+
count.index,
286+
)}-eks_asg"
287+
},
288+
var.tags,
289+
)
290+
}
291+
277292
tags = var.tags
278293

279294
lifecycle {

workers_launch_template_mixed.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,21 @@ resource "aws_launch_template" "workers_launch_template_mixed" {
316316
}
317317
}
318318

319+
tag_specifications {
320+
resource_type = "volume"
321+
322+
tags = merge(
323+
{
324+
"Name" = "${aws_eks_cluster.this.name}-${lookup(
325+
var.worker_groups_launch_template[count.index],
326+
"name",
327+
count.index,
328+
)}-eks_asg"
329+
},
330+
var.tags,
331+
)
332+
}
333+
319334
tags = var.tags
320335

321336
lifecycle {

0 commit comments

Comments
 (0)