Skip to content

Commit f2eb809

Browse files
npalmkonkerama
andauthored
fix: added missing launch template tag_specifications (#4544)
copy from #4531 Currently the launch template specification adds tags only on resource types of `instance` and `volume` this leaves the other 2 supported resource types (`spot-instances-request` and `network-interface`) untagged which by extensions does not produce accurate data on Cost Explorer. This pr fixes this by adding the missing `tag_specifications` configurations. --------- Co-authored-by: konkerama <[email protected]>
1 parent dc385cd commit f2eb809

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

modules/runners/main.tf

+28
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,34 @@ resource "aws_launch_template" "runner" {
206206
)
207207
}
208208

209+
tag_specifications {
210+
resource_type = "spot-instances-request"
211+
tags = merge(
212+
local.tags,
213+
{
214+
"Name" = format("%s", local.name_runner)
215+
},
216+
{
217+
"ghr:runner_name_prefix" = var.runner_name_prefix
218+
},
219+
var.runner_ec2_tags
220+
)
221+
}
222+
223+
tag_specifications {
224+
resource_type = "network-interface"
225+
tags = merge(
226+
local.tags,
227+
{
228+
"Name" = format("%s", local.name_runner)
229+
},
230+
{
231+
"ghr:runner_name_prefix" = var.runner_name_prefix
232+
},
233+
var.runner_ec2_tags
234+
)
235+
}
236+
209237
user_data = var.runner_os == "windows" ? base64encode(local.user_data) : base64gzip(local.user_data)
210238

211239
tags = local.tags

modules/runners/pool/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ resource "aws_iam_role" "scheduler" {
189189
permissions_boundary = var.config.role_permissions_boundary
190190

191191
assume_role_policy = data.aws_iam_policy_document.scheduler_assume.json
192-
tags = var.config.tags
192+
tags = var.config.tags
193193
}
194194

195195
resource "aws_iam_role_policy" "scheduler" {

0 commit comments

Comments
 (0)