From 492700c94a04464bf14393ad5322ef8a1a10f118 Mon Sep 17 00:00:00 2001 From: Dana Hoffman Date: Wed, 24 Jan 2018 12:50:39 -0800 Subject: [PATCH] Add update support for machine type, min cpu platform, and service accounts (#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 --- docs/r/compute_instance.html.markdown | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/r/compute_instance.html.markdown b/docs/r/compute_instance.html.markdown index 4965ea67449..236fe46266c 100644 --- a/docs/r/compute_instance.html.markdown +++ b/docs/r/compute_instance.html.markdown @@ -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. @@ -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 @@ -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 @@ -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. @@ -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. @@ -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: @@ -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`.