Skip to content

googleComputeSubnetwork

Get a subnetwork within GCE from its name and region.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.dataGoogleComputeSubnetwork.DataGoogleComputeSubnetwork(
  this,
  "my-subnetwork",
  {
    name: "default-us-east1",
    region: "us-east1",
  }
);

Argument Reference

The following arguments are supported:

  • selfLink - (Optional) The self link of the subnetwork. If selfLink is specified, name, project, and region are ignored.

  • name - (Optional) The name of the subnetwork. One of name or selfLink must be specified.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region - (Optional) The region this subnetwork has been created in. If unspecified, this defaults to the region configured in the provider.

Attributes Reference

In addition to the arguments listed above, the following attributes are exported:

  • network - The network name or resource link to the parent network of this subnetwork.

  • description - Description of this subnetwork.

  • ipCidrRange - The IP address range that machines in this network are assigned to, represented as a CIDR block.

  • gatewayAddress - The IP address of the gateway.

  • privateIpGoogleAccess - Whether the VMs in this subnet can access Google services without assigned external IP addresses.

  • secondaryIpRange - An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. Structure is documented below.

The secondaryIpRange block supports:

  • rangeName - The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance.

  • ipCidrRange - The range of IP addresses belonging to this subnetwork secondary range.