Skip to content

Commit 492700c

Browse files
authored
Add update support for machine type, min cpu platform, and service accounts (hashicorp#1005)
* Add update support for compute instance fields that require the machine to be stopped * add warnings in docs about stopping the instance before updating * add allow_stopping_for_update field
1 parent 865bbc8 commit 492700c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/r/compute_instance.html.markdown

+14-8
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ The following arguments are supported:
6363

6464
* `machine_type` - (Required) The machine type to create. To create a custom
6565
machine type, value should be set as specified
66-
[here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType)
66+
[here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType).
67+
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.
6768

6869
* `name` - (Required) A unique name for the resource, required by GCE.
6970
Changing this forces a new resource to be created.
@@ -75,6 +76,9 @@ The following arguments are supported:
7576

7677
- - -
7778

79+
* `allow_stopping_for_update` - (Optional) If true, allows Terraform to stop the instance to update its properties.
80+
If you try to update a property that requires stopping the instance without setting this field, the update will fail.
81+
7882
* `attached_disk` - (Optional) List of disks to attach to the instance. Structure is documented below.
7983

8084
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of
@@ -86,6 +90,8 @@ The following arguments are supported:
8690

8791
* `description` - (Optional) A brief description of this resource.
8892

93+
* `guest_accelerator` - (Optional) List of the type and count of accelerator cards attached to the instance. Structure documented below.
94+
8995
* `labels` - (Optional) A set of key/value label pairs to assign to the instance.
9096

9197
* `metadata` - (Optional) Metadata key/value pairs to make available from
@@ -97,6 +103,10 @@ The following arguments are supported:
97103
startup-script metadata key on the created instance and thus the two
98104
mechanisms are not allowed to be used simultaneously.
99105

106+
* `min_cpu_platform` - (Optional) Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
107+
`Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
108+
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.
109+
100110
* `project` - (Optional) The project in which the resource belongs. If it
101111
is not provided, the provider project is used.
102112

@@ -108,6 +118,7 @@ The following arguments are supported:
108118

109119
* `service_account` - (Optional) Service account to attach to the instance.
110120
Structure is documented below.
121+
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.
111122

112123
* `tags` - (Optional) A list of tags to attach to the instance.
113124

@@ -215,10 +226,12 @@ The `service_account` block supports:
215226

216227
* `email` - (Optional) The service account e-mail address. If not given, the
217228
default Google Compute Engine service account is used.
229+
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.
218230

219231
* `scopes` - (Required) A list of service scopes. Both OAuth2 URLs and gcloud
220232
short names are supported. To allow full access to all Cloud APIs, use the
221233
`cloud-platform` scope. See a complete list of scopes [here](https://cloud.google.com/sdk/gcloud/reference/alpha/compute/instances/set-scopes#--scopes).
234+
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.
222235

223236
The `scheduling` block supports:
224237

@@ -231,13 +244,6 @@ The `scheduling` block supports:
231244
* `automatic_restart` - (Optional) Specifies if the instance should be
232245
restarted if it was terminated by Compute Engine (not a user).
233246

234-
---
235-
236-
* `guest_accelerator` - (Optional) List of the type and count of accelerator cards attached to the instance. Structure documented below.
237-
238-
* `min_cpu_platform` - (Optional) Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
239-
`Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
240-
241247
The `guest_accelerator` block supports:
242248

243249
* `type` (Required) - The accelerator type resource to expose to this instance. E.g. `nvidia-tesla-k80`.

0 commit comments

Comments
 (0)