Skip to content

Commit

Permalink
Add update support for machine type, min cpu platform, and service ac…
Browse files Browse the repository at this point in the history
…counts (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
  • Loading branch information
danawillow authored Jan 24, 2018
1 parent 865bbc8 commit 492700c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/r/compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ The following arguments are supported:

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

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

- - -

* `allow_stopping_for_update` - (Optional) If true, allows Terraform to stop the instance to update its properties.
If you try to update a property that requires stopping the instance without setting this field, the update will fail.

* `attached_disk` - (Optional) List of disks to attach to the instance. Structure is documented below.

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

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

* `guest_accelerator` - (Optional) List of the type and count of accelerator cards attached to the instance. Structure documented below.

* `labels` - (Optional) A set of key/value label pairs to assign to the instance.

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

* `min_cpu_platform` - (Optional) Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
`Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
**Note**: [`allow_stopping_for_update`](#allow_stopping_for_update) must be set to true in order to update this field.

* `project` - (Optional) The project in which the resource belongs. If it
is not provided, the provider project is used.

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

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

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

Expand Down Expand Up @@ -215,10 +226,12 @@ The `service_account` block supports:

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

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

The `scheduling` block supports:

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

---

* `guest_accelerator` - (Optional) List of the type and count of accelerator cards attached to the instance. Structure documented below.

* `min_cpu_platform` - (Optional) Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
`Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).

The `guest_accelerator` block supports:

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

0 comments on commit 492700c

Please sign in to comment.