blob: 934099fb15b2df911fecf4004f1c186206dcfe53 [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: "Distributed Cloud Edge Network"
description: |-
A Distributed Cloud Edge subnet, which provides L2 isolation within a network.
---
# google_edgenetwork_subnet
A Distributed Cloud Edge subnet, which provides L2 isolation within a network.
To get more information about Subnet, see:
* [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/network/rest/v1/projects.locations.zones.subnets)
* How-to Guides
* [Create and manage subnetworks](https://cloud.google.com/distributed-cloud/edge/latest/docs/subnetworks#api)
## Example Usage - Edgenetwork Subnet
```hcl
resource "google_edgenetwork_subnet" "example_subnet" {
subnet_id = "example-subnet"
location = "us-west1"
zone = ""
description = "Example subnet."
network = google_edgenetwork_network.example_network.id
ipv4_cidr = ["4.4.4.1/24"]
labels = {
"environment" : "dev"
}
}
resource "google_edgenetwork_network" "example_network" {
network_id = "example-network"
location = "us-west1"
zone = ""
description = "Example network."
mtu = 9000
}
```
## Example Usage - Edgenetwork Subnet With Vlan Id
```hcl
resource "google_edgenetwork_subnet" "example_subnet_with_vlan_id" {
subnet_id = "example-subnet-with-vlan-id"
location = "us-west1"
zone = ""
description = "Example subnet with VLAN ID."
network = google_edgenetwork_network.example_network.id
ipv6_cidr = ["4444:4444:4444:4444::1/64"]
vlan_id = 44
labels = {
"environment" : "dev"
}
}
resource "google_edgenetwork_network" "example_network" {
network_id = "example-network"
location = "us-west1"
zone = ""
description = "Example network."
mtu = 9000
}
```
## Argument Reference
The following arguments are supported:
* `network` -
(Required)
The ID of the network to which this router belongs.
Must be of the form: `projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}`
* `location` -
(Required)
The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
* `zone` -
(Required)
The name of the target Distributed Cloud Edge zone.
* `subnet_id` -
(Required)
A unique ID that identifies this subnet.
- - -
* `labels` -
(Optional)
Labels associated with this resource.
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field `effective_labels` for all of the labels present on the resource.
* `description` -
(Optional)
A free-text description of the resource. Max length 1024 characters.
* `ipv4_cidr` -
(Optional)
The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
* `ipv6_cidr` -
(Optional)
The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
* `vlan_id` -
(Optional)
VLAN ID for this subnetwork. If not specified, one is assigned automatically.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}`
* `name` -
The canonical name of this resource, with format
`projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}`
* `create_time` -
The time when the subnet was created.
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` -
The time when the subnet was last updated.
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`.
* `state` -
Current stage of the resource to the device by config push.
* `terraform_labels` -
The combination of labels configured directly on the resource
and default labels configured on the provider.
* `effective_labels` -
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
## 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 30 minutes.
## Import
Subnet can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}`
* `{{project}}/{{location}}/{{zone}}/{{subnet_id}}`
* `{{location}}/{{zone}}/{{subnet_id}}`
* `{{location}}/{{subnet_id}}`
* `{{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 = "projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}"
to = google_edgenetwork_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_edgenetwork_subnet.default projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
$ terraform import google_edgenetwork_subnet.default {{project}}/{{location}}/{{zone}}/{{subnet_id}}
$ terraform import google_edgenetwork_subnet.default {{location}}/{{zone}}/{{subnet_id}}
$ terraform import google_edgenetwork_subnet.default {{location}}/{{subnet_id}}
$ terraform import google_edgenetwork_subnet.default {{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).