diff --git a/r/compute_instance.html.markdown b/r/compute_instance.html.markdown index 1074d011..109f2af9 100644 --- a/r/compute_instance.html.markdown +++ b/r/compute_instance.html.markdown @@ -120,7 +120,12 @@ the type is "local-ssd", in which case scratch must be true). The `network_interface` block supports: -* `network` - (Required) The name of the network to attach this interface to. +* `network` - (Optional) The name of the network to attach this interface to. Either + `network` or `subnetwork` must be provided. + +* `subnetwork` - (Optional) the name of the subnetwork to attach this interface to. The subnetwork + must exist in the same region this instance is to be created in. Either `network` + or `subnetwork` must be provided. * `access_config` - (Optional) Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet diff --git a/r/compute_network.html.markdown b/r/compute_network.html.markdown index 1306a092..bd982055 100644 --- a/r/compute_network.html.markdown +++ b/r/compute_network.html.markdown @@ -26,8 +26,17 @@ The following arguments are supported: * `name` - (Required) A unique name for the resource, required by GCE. Changing this forces a new resource to be created. -* `ipv4_range` - (Required) The IPv4 address range that machines in this - network are assigned to, represented as a CIDR block. +* `ipv4_range` - (Optional) The IPv4 address range that machines in this + network are assigned to, represented as a CIDR block. If not + set, an auto or custom subnetted network will be created, depending + on the value of `auto_create_subnetworks` attribute. + +* `auto_create_subnetworks` - (Optional) If set to true, this network + will be created in auto subnet mode, and Google will create a + subnet for each region automatically. + If set to false, and `ipv4_range` is not set, a custom subnetted + network will be created that can support `google_compute_subnetwork` + resources. ## Attributes Reference diff --git a/r/compute_subnetwork.html.markdown b/r/compute_subnetwork.html.markdown new file mode 100644 index 00000000..4bc373ec --- /dev/null +++ b/r/compute_subnetwork.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "google" +page_title: "Google: google_compute_subnetwork" +sidebar_current: "docs-google-compute-subnetwork" +description: |- + Manages a subnetwork within GCE. +--- + +# google\_compute\_subnetwork + +Manages a subnetwork within GCE. + +## Example Usage + +``` +resource "google_compute_subnetwork" "default-us-east1" { + name = "default-us-east1" + ip_cidr_range = "10.0.0.0/16" + network = "${google_compute_network.default.self_link}" + region = "us-east1" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + +* `network` - (Required) A link to the parent network of this subnetwork. + The parent network must have been created in custom subnet mode. + +* `ip_cidr_range` - (Required) The IP address range that machines in this + network are assigned to, represented as a CIDR block. + +* `region` - (Required) The region this subnetwork will be created in. + +* `description` - (Optional) Description of this subnetwork. + +## Attributes Reference + +The following attributes are exported: + +* `name` - The name of the resource. +* `ip_cidr_range` - The CIDR block of this network. +* `gateway_address` - The IP address of the gateway.