This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree 3 files changed +34
-9
lines changed
3 files changed +34
-9
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
42
42
default = 8
43
43
}
44
44
45
+ variable "ebs_delete_on_termination" {
46
+ description = " Indicates whether the EBS volume is deleted on instance termination."
47
+ type = bool
48
+ default = true
49
+ }
50
+
45
51
variable "global_tags" {
46
52
description = " Tags to apply to everything"
47
53
type = map (string )
@@ -91,9 +97,10 @@ source "amazon-ebs" "githubrunner" {
91
97
92
98
93
99
launch_block_device_mappings {
94
- device_name = " /dev/xvda"
95
- volume_size = " ${ var . root_volume_size_gb } "
96
- volume_type = " gp3"
100
+ device_name = " /dev/xvda"
101
+ volume_size = " ${ var . root_volume_size_gb } "
102
+ volume_type = " gp3"
103
+ delete_on_termination = " ${ var . ebs_delete_on_termination } "
97
104
}
98
105
}
99
106
@@ -151,4 +158,4 @@ build {
151
158
]
152
159
}
153
160
154
- }
161
+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
42
42
default = 8
43
43
}
44
44
45
+ variable "ebs_delete_on_termination" {
46
+ description = " Indicates whether the EBS volume is deleted on instance termination."
47
+ type = bool
48
+ default = true
49
+ }
50
+
45
51
variable "global_tags" {
46
52
description = " Tags to apply to everything"
47
53
type = map (string )
@@ -90,9 +96,10 @@ source "amazon-ebs" "githubrunner" {
90
96
)
91
97
92
98
launch_block_device_mappings {
93
- device_name = " /dev/sda1"
94
- volume_size = " ${ var . root_volume_size_gb } "
95
- volume_type = " gp3"
99
+ device_name = " /dev/sda1"
100
+ volume_size = " ${ var . root_volume_size_gb } "
101
+ volume_type = " gp3"
102
+ delete_on_termination = " ${ var . ebs_delete_on_termination } "
96
103
}
97
104
}
98
105
@@ -161,4 +168,4 @@ build {
161
168
]
162
169
}
163
170
164
- }
171
+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ variable "region" {
19
19
default = " eu-west-1"
20
20
}
21
21
22
+ variable "ebs_delete_on_termination" {
23
+ description = " Indicates whether the EBS volume is deleted on instance termination."
24
+ type = bool
25
+ default = true
26
+ }
27
+
22
28
source "amazon-ebs" "githubrunner" {
23
29
ami_name = " github-runner-windows-core-2019-${ formatdate (" YYYYMMDDhhmm" , timestamp ())} "
24
30
communicator = " winrm"
@@ -43,6 +49,11 @@ source "amazon-ebs" "githubrunner" {
43
49
winrm_port = 5986
44
50
winrm_use_ssl = true
45
51
winrm_username = " Administrator"
52
+
53
+ launch_block_device_mappings {
54
+ device_name = " /dev/sda1"
55
+ delete_on_termination = " ${ var . ebs_delete_on_termination } "
56
+ }
46
57
}
47
58
48
59
build {
@@ -63,4 +74,4 @@ build {
63
74
action_runner_url = var.action_runner_url
64
75
})]
65
76
}
66
- }
77
+ }
You can’t perform that action at this time.
0 commit comments