Skip to content

Commit 96ae483

Browse files
committed
Allow addtional tags to attach to the resources
1 parent 3453a18 commit 96ae483

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

main.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ resource "aws_key_pair" "this" {
2020
key_name = "gitlab-docker-runner"
2121
public_key = var.ssh_public_key
2222

23-
tags = local.tags
23+
tags = merge(
24+
local.tags,
25+
var.additional_tags,
26+
)
2427
}
2528

2629
resource "aws_instance" "this" {
@@ -34,5 +37,8 @@ resource "aws_instance" "this" {
3437
user_data = local.runner_user_data
3538
user_data_replace_on_change = var.user_data_replace_on_change
3639

37-
tags = local.tags
40+
tags = merge(
41+
local.tags,
42+
var.additional_tags,
43+
)
3844
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ variable "user_data_replace_on_change" {
3434
default = true
3535
}
3636

37+
variable "additional_tags" {
38+
description = "Additional tags to apply to the resources"
39+
type = map(string)
40+
default = {}
41+
}
42+
3743
variable "gitlab_url" {
3844
description = "Gitlab URL"
3945
type = string

0 commit comments

Comments
 (0)