Skip to content

Commit a89a025

Browse files
GeneralAardvarkSimon Whittle
andauthored
fix: Add support for disk_name and device_name on additional_disks (#132)
Co-authored-by: Simon Whittle <[email protected]>
1 parent 4916893 commit a89a025

File tree

7 files changed

+16
-2
lines changed

7 files changed

+16
-2
lines changed

examples/instance_template/additional_disks/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,24 @@ module "instance_template" {
3030

3131
additional_disks = [
3232
{
33+
disk_name = "disk-0"
34+
device_name = "disk-0"
3335
disk_size_gb = 10
3436
disk_type = "pd-standard"
3537
auto_delete = "true"
3638
boot = "false"
3739
},
3840
{
41+
disk_name = "disk-1"
42+
device_name = "disk-1"
3943
disk_size_gb = 10
4044
disk_type = "pd-standard"
4145
auto_delete = "true"
4246
boot = "false"
4347
},
4448
{
49+
disk_name = "disk-2"
50+
device_name = "disk-2"
4551
disk_size_gb = 10
4652
disk_type = "pd-standard"
4753
auto_delete = "true"

examples/mig/full/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ variable "auto_delete" {
124124
variable "additional_disks" {
125125
description = "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name"
126126
type = list(object({
127+
disk_name = string
128+
device_name = string
127129
auto_delete = bool
128130
boot = bool
129131
disk_size_gb = number

examples/umig/full/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ variable "auto_delete" {
124124
variable "additional_disks" {
125125
description = "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name"
126126
type = list(object({
127+
disk_name = string
128+
device_name = string
127129
auto_delete = bool
128130
boot = bool
129131
disk_size_gb = number

modules/instance_template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
1616
| Name | Description | Type | Default | Required |
1717
|------|-------------|------|---------|:--------:|
1818
| access\_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. | <pre>list(object({<br> nat_ip = string<br> network_tier = string<br> }))</pre> | `[]` | no |
19-
| additional\_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name | <pre>list(object({<br> auto_delete = bool<br> boot = bool<br> disk_size_gb = number<br> disk_type = string<br> }))</pre> | `[]` | no |
19+
| additional\_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name | <pre>list(object({<br> disk_name = string<br> device_name = string<br> auto_delete = bool<br> boot = bool<br> disk_size_gb = number<br> disk_type = string<br> }))</pre> | `[]` | no |
2020
| auto\_delete | Whether or not the boot disk should be auto-deleted | `string` | `"true"` | no |
2121
| can\_ip\_forward | Enable IP forwarding, for NAT instances for example | `string` | `"false"` | no |
2222
| disk\_size\_gb | Boot disk size in GB | `string` | `"100"` | no |

modules/instance_template/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ variable "auto_delete" {
9595
variable "additional_disks" {
9696
description = "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name"
9797
type = list(object({
98+
disk_name = string
99+
device_name = string
98100
auto_delete = bool
99101
boot = bool
100102
disk_size_gb = number

modules/preemptible_and_regular_instance_templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the [simple](../../examples/preemptible_and_regular_instance_templates/simpl
1313
| Name | Description | Type | Default | Required |
1414
|------|-------------|------|---------|:--------:|
1515
| access\_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. | <pre>list(object({<br> nat_ip = string<br> network_tier = string<br> }))</pre> | `[]` | no |
16-
| additional\_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name | <pre>list(object({<br> auto_delete = bool<br> boot = bool<br> disk_size_gb = number<br> disk_type = string<br> }))</pre> | `[]` | no |
16+
| additional\_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name | <pre>list(object({<br> disk_name = string<br> device_name = string<br> auto_delete = bool<br> boot = bool<br> disk_size_gb = number<br> disk_type = string<br> }))</pre> | `[]` | no |
1717
| auto\_delete | Whether or not the boot disk should be auto-deleted | `bool` | `true` | no |
1818
| can\_ip\_forward | Enable IP forwarding, for NAT instances for example | `string` | `"false"` | no |
1919
| disk\_size\_gb | Boot disk size in GB | `string` | `"100"` | no |

modules/preemptible_and_regular_instance_templates/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ variable "auto_delete" {
8383
variable "additional_disks" {
8484
description = "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name"
8585
type = list(object({
86+
disk_name = string
87+
device_name = string
8688
auto_delete = bool
8789
boot = bool
8890
disk_size_gb = number

0 commit comments

Comments
 (0)