Subnet in a private cloud. A Private Cloud contains two types of subnets: management
subnets (such as vMotion) that
are read-only,and userDefined
, which can also be updated. This resource should be used to read and update userDefined
subnets. To read management
subnets, please utilize the subnet data source.
To get more information about Subnet, see:
resource "google_vmwareengine_network" "subnet-nw" {
name = "pc-nw"
location = "global"
type = "STANDARD"
description = "PC network description."
}
resource "google_vmwareengine_private_cloud" "subnet-pc" {
location = "us-west1-a"
name = "sample-pc"
description = "Sample test PC."
network_config {
management_cidr = "192.168.50.0/24"
vmware_engine_network = google_vmwareengine_network.subnet-nw.id
}
management_cluster {
cluster_id = "sample-mgmt-cluster"
node_type_configs {
node_type_id = "standard-72"
node_count = 3
}
}
}
resource "google_vmwareengine_subnet" "vmw-engine-subnet" {
name = "service-1"
parent = google_vmwareengine_private_cloud.subnet-pc.id
ip_cidr_range = "192.168.100.0/26"
}
The following arguments are supported:
ip_cidr_range
-
(Required)
The IP address range of the subnet in CIDR format.
parent
-
(Required)
The resource name of the private cloud to create a new subnet in.
Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
For example: projects/my-project/locations/us-west1-a/privateClouds/my-cloud
name
-
(Required)
The ID of the subnet. For userDefined subnets, this name should be in the format of "service-n",
where n ranges from 1 to 5.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{parent}}/subnets/{{name}}
create_time
-
Creation time of this resource.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and
up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
update_time
-
Last updated time of this resource.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine
fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
gateway_ip
-
The IP address of the gateway of this subnet. Must fall within the IP prefix defined above.
gateway_id
-
The canonical identifier of the logical router that this subnet is attached to.
dhcp_address_ranges
-
DHCP address ranges.
Structure is documented below.
type
-
The type of the subnet.
standard_config
-
Whether the NSX-T configuration in the backend follows the standard configuration supported by Google Cloud.
If false, the subnet cannot be modified through Google Cloud, only through NSX-T directly.
state
-
State of the subnet.
uid
-
System-generated unique identifier for the resource.
vlan_id
-
VLAN ID of the VLAN on which the subnet is configured.
The dhcp_address_ranges
block contains:
first_address
-
(Output)
The first IP address of the range.
last_address
-
(Output)
The last IP address of the range.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Subnet can be imported using any of these accepted formats:
{{parent}}/subnets/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Subnet using one of the formats above. For example:
import {
id = "{{parent}}/subnets/{{name}}"
to = google_vmwareengine_subnet.default
}
When using the terraform import
command, Subnet can be imported using one of the formats above. For example:
$ terraform import google_vmwareengine_subnet.default {{parent}}/subnets/{{name}}