Skip to content

Commit d509000

Browse files
authored
feat: Add specific variables to add tags to launch template (#285)
1 parent bb29c08 commit d509000

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ No modules.
319319
| <a name="input_launch_template_description"></a> [launch\_template\_description](#input\_launch\_template\_description) | Description of the launch template | `string` | `null` | no |
320320
| <a name="input_launch_template_id"></a> [launch\_template\_id](#input\_launch\_template\_id) | ID of an existing launch template to be used (created outside of this module) | `string` | `null` | no |
321321
| <a name="input_launch_template_name"></a> [launch\_template\_name](#input\_launch\_template\_name) | Name of launch template to be created | `string` | `""` | no |
322+
| <a name="input_launch_template_tags"></a> [launch\_template\_tags](#input\_launch\_template\_tags) | A map of additional tags to add to the launch template | `map(string)` | `{}` | no |
322323
| <a name="input_launch_template_use_name_prefix"></a> [launch\_template\_use\_name\_prefix](#input\_launch\_template\_use\_name\_prefix) | Determines whether to use `launch_template_name` as is or create a unique name beginning with the `launch_template_name` as the prefix | `bool` | `true` | no |
323324
| <a name="input_launch_template_version"></a> [launch\_template\_version](#input\_launch\_template\_version) | Launch template version. Can be version number, `$Latest`, or `$Default` | `string` | `null` | no |
324325
| <a name="input_license_specifications"></a> [license\_specifications](#input\_license\_specifications) | A list of license specifications to associate with | `map(string)` | `{}` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ resource "aws_launch_template" "this" {
347347
create_before_destroy = true
348348
}
349349

350-
tags = var.tags
350+
tags = merge(var.tags, var.launch_template_tags)
351351
}
352352

353353
################################################################################

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,12 @@ variable "tag_specifications" {
462462
default = []
463463
}
464464

465+
variable "launch_template_tags" {
466+
description = "A map of additional tags to add to the launch template"
467+
type = map(string)
468+
default = {}
469+
}
470+
465471
################################################################################
466472
# Autoscaling group traffic source attachment
467473
################################################################################

0 commit comments

Comments
 (0)