File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
4242 default = 8
4343}
4444
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+
4551variable "global_tags" {
4652 description = " Tags to apply to everything"
4753 type = map (string )
@@ -91,9 +97,10 @@ source "amazon-ebs" "githubrunner" {
9197
9298
9399 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 } "
97104 }
98105}
99106
@@ -151,4 +158,4 @@ build {
151158 ]
152159 }
153160
154- }
161+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
4242 default = 8
4343}
4444
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+
4551variable "global_tags" {
4652 description = " Tags to apply to everything"
4753 type = map (string )
@@ -90,9 +96,10 @@ source "amazon-ebs" "githubrunner" {
9096 )
9197
9298 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 } "
96103 }
97104}
98105
@@ -161,4 +168,4 @@ build {
161168 ]
162169 }
163170
164- }
171+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ variable "region" {
1919 default = " eu-west-1"
2020}
2121
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+
2228source "amazon-ebs" "githubrunner" {
2329 ami_name = " github-runner-windows-core-2019-${ formatdate (" YYYYMMDDhhmm" , timestamp ())} "
2430 communicator = " winrm"
@@ -43,6 +49,11 @@ source "amazon-ebs" "githubrunner" {
4349 winrm_port = 5986
4450 winrm_use_ssl = true
4551 winrm_username = " Administrator"
52+
53+ launch_block_device_mappings {
54+ device_name = " /dev/sda1"
55+ delete_on_termination = " ${ var . ebs_delete_on_termination } "
56+ }
4657}
4758
4859build {
@@ -63,4 +74,4 @@ build {
6374 action_runner_url = var.action_runner_url
6475 })]
6576 }
66- }
77+ }
You can’t perform that action at this time.
0 commit comments