Skip to content

Commit 86e4867

Browse files
Add network attachment to gce instance (#8829) (#15933)
* first draft for new Network Attachment resource * updated NetworkAttachment specification file * added usage example for Network Attachment with GCE Instance * verified attributes and descriptions * enhanced network attachment examples * adding network attachment field to compute instance network interface * added network attachment specification to yaml file * added integration tests * fixing minor typo * fixed typo * fixed typo * fixed tf config * fixed typo * fixed network attachment simple test * updated instance resource documentation * removed bad logic network attachment validation * fixed tests and field specification for network attachment Signed-off-by: Modular Magician <[email protected]>
1 parent 96100fc commit 86e4867

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.changelog/8829.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
google_compute_instance
3+
```

website/docs/r/compute_instance.html.markdown

+11-8
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ is desired, you will need to modify your state file manually using
236236
For instance, the image `centos-6-v20180104` includes its family name `centos-6`.
237237
These images can be referred by family name here.
238238

239-
* `labels` - (Optional) A set of key/value label pairs assigned to the disk. This
239+
* `labels` - (Optional) A set of key/value label pairs assigned to the disk. This
240240
field is only applicable for persistent disks.
241241

242242
* `resource_manager_tags` - (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource.
@@ -285,6 +285,7 @@ is desired, you will need to modify your state file manually using
285285
network is in auto subnet mode, specifying the subnetwork is optional. If the network is
286286
in custom subnet mode, specifying the subnetwork is required.
287287

288+
288289
* `subnetwork_project` - (Optional) The project in which the subnetwork belongs.
289290
If the `subnetwork` is a self_link, this field is ignored in favor of the project
290291
defined in the subnetwork self_link. If the `subnetwork` is a name and this
@@ -306,6 +307,8 @@ is desired, you will need to modify your state file manually using
306307

307308
* `nic_type` - (Optional) The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
308309

310+
* `network_attachment` - (Optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) The URL of the network attachment that this interface should connect to in the following format: `projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}`.
311+
309312
* `stack_type` - (Optional) The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6 or IPV4_ONLY. If not specified, IPV4_ONLY will be used.
310313

311314
* `ipv6_access_config` - (Optional) An array of IPv6 access configurations for this interface.
@@ -331,14 +334,14 @@ specified, then this instance will have no external IPv6 Internet access. Struct
331334

332335
<a name="nested_ipv6_access_config"></a>The `ipv6_access_config` block supports:
333336

334-
* `external_ipv6` - (Optional) The first IPv6 address of the external IPv6 range associated
335-
with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig.
336-
To use a static external IP address, it must be unused and in the same region as the instance's zone.
337+
* `external_ipv6` - (Optional) The first IPv6 address of the external IPv6 range associated
338+
with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig.
339+
To use a static external IP address, it must be unused and in the same region as the instance's zone.
337340
If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork.
338341

339342
* `external_ipv6_prefix_length` - (Optional) The prefix length of the external IPv6 range.
340343

341-
* `name` - (Optional) The name of this access configuration. In ipv6AccessConfigs, the recommended name
344+
* `name` - (Optional) The name of this access configuration. In ipv6AccessConfigs, the recommended name
342345
is "External IPv6".
343346

344347
* `network_tier` - (Optional) The service-level to be provided for IPv6 traffic when the
@@ -390,12 +393,12 @@ specified, then this instance will have no external IPv6 Internet access. Struct
390393

391394
* `min_node_cpus` - (Optional) The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
392395

393-
* `provisioning_model` - (Optional) Describe the type of preemptible VM. This field accepts the value `STANDARD` or `SPOT`. If the value is `STANDARD`, there will be no discount. If this is set to `SPOT`,
396+
* `provisioning_model` - (Optional) Describe the type of preemptible VM. This field accepts the value `STANDARD` or `SPOT`. If the value is `STANDARD`, there will be no discount. If this is set to `SPOT`,
394397
`preemptible` should be `true` and `automatic_restart` should be
395398
`false`. For more info about
396399
`SPOT`, read [here](https://cloud.google.com/compute/docs/instances/spot)
397-
398-
* `instance_termination_action` - (Optional) Describe the type of termination action for VM. Can be `STOP` or `DELETE`. Read more on [here](https://cloud.google.com/compute/docs/instances/create-use-spot)
400+
401+
* `instance_termination_action` - (Optional) Describe the type of termination action for VM. Can be `STOP` or `DELETE`. Read more on [here](https://cloud.google.com/compute/docs/instances/create-use-spot)
399402

400403
* `max_run_duration` - (Optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in `instance_termination_action`. Only support `DELETE` `instance_termination_action` at this point. Structure is [documented below](#nested_max_run_duration).
401404
<a name="nested_max_run_duration"></a>The `max_run_duration` block supports:

0 commit comments

Comments
 (0)