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

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

Merged
merged 2 commits into from
Jul 30, 2019
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions workers_launch_template_mixed.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a typo here I missed. Should be var.worker_groups_launch_template_mixed[count.index],. Fixed in latest release though 😃

#452

"name",
count.index,
)}-eks_asg"
},
var.tags,
)
}

tags = var.tags

lifecycle {
Expand Down