Subnetwork
A resource of the GCP provider, version 0.2.0, in its Networking group. Import it with:
import Subnetwork from "gcp/networking"Example
resource Subnetwork example {
name = "example-value"
network = "example-value"
ipCidrRange = "example-value"
region = "example-value"
privateIpGoogleAccess = false
description = "example-value"
}Properties
Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | string | — | No | The name of the subnetwork |
network | string | — | No | The VPC network name or self-link this subnet belongs to |
ipCidrRange | string | — | No | The IPv4 CIDR range for this subnetwork (e.g., 10.0.1.0/24) |
region | string | — | No | The GCP region for this subnetwork (e.g., us-central1) |
privateIpGoogleAccess | boolean | false | No | Whether VMs in this subnet can access Google APIs without external IP |
description | string | — | No | An optional description of the subnetwork |
Set by GCP after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.
| Name | Type | Importable | Description |
|---|---|---|---|
subnetworkId | string | Yes | The unique subnetwork ID assigned by GCP |
selfLink | string | No | The self-link URL of the subnetwork |
gatewayAddress | string | No | The gateway address for default routing in this subnetwork |