We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83c19cd commit 2b1d9b6Copy full SHA for 2b1d9b6
modules/runners/main.tf
@@ -206,18 +206,21 @@ resource "aws_launch_template" "runner" {
206
)
207
}
208
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
- )
+ dynamic "tag_specifications" {
+ for_each = var.instance_target_capacity_type == "spot" ? 1 : 0
+ content {
+ resource_type = "spot-instances-request"
+ tags = merge(
+ local.tags,
+ {
+ "Name" = format("%s", local.name_runner)
+ },
+ "ghr:runner_name_prefix" = var.runner_name_prefix
221
+ var.runner_ec2_tags
222
+ )
223
+ }
224
225
226
tag_specifications {
0 commit comments