Skip to content

Commit c375dfc

Browse files
committed
recreate runner instance when user_data changes
1 parent b0d6cee commit c375dfc

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ locals {
33
Name = "gitlab-docker-runner"
44
ManagedBy = "Terraform"
55
}
6-
runner_user_data = templatefile("templates/runner.tftpl", {
6+
runner_user_data = templatefile("${path.module}/templates/runner.tftpl", {
77
gitlab_url = var.gitlab_url
88
runner_registration_token = var.runner_registration_token
99
docker_image = var.docker_image
@@ -35,8 +35,7 @@ resource "aws_instance" "this" {
3535
vpc_security_group_ids = var.vpc_security_group_ids
3636
subnet_id = var.subnet_id
3737
user_data = local.runner_user_data
38-
user_data_replace_on_change = var.user_data_replace_on_change
39-
38+
user_data_replace_on_change = true
4039
tags = merge(
4140
local.tags,
4241
var.additional_tags,

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ variable "subnet_id" {
2828
default = ""
2929
}
3030

31-
variable "user_data_replace_on_change" {
32-
description = "Recreate the instance when the user data changes"
33-
type = bool
34-
default = true
35-
}
36-
3731
variable "additional_tags" {
3832
description = "Additional tags to apply to the resources"
3933
type = map(string)

0 commit comments

Comments
 (0)