blob: 0b30b2c4ab8615ba482b78608bb2ba85ca5d7e98 [file] [log] [blame] [edit]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Cloud VMware Engine"
description: |-
Subnet in a private cloud.
---
# google_vmwareengine_subnet
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:
* [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.privateClouds.subnets)
## Example Usage - Vmware Engine Subnet User Defined
```hcl
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"
}
```
## Argument Reference
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.
- - -
## Attributes Reference
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](#nested_dhcp_address_ranges).
* `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.
<a name="nested_dhcp_address_ranges"></a>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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
Subnet can be imported using any of these accepted formats:
* `{{parent}}/subnets/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Subnet using one of the formats above. For example:
```tf
import {
id = "{{parent}}/subnets/{{name}}"
to = google_vmwareengine_subnet.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Subnet can be imported using one of the formats above. For example:
```
$ terraform import google_vmwareengine_subnet.default {{parent}}/subnets/{{name}}
```