terraform-provider-google/d/datasource_compute_subnetwork.html.markdown
Mathieu Herbert 2e6c5779d4 provider/google: datasource subnetwork and network (#12442)
* first version of this datasource

* add network and subnetwork datasource and documentation

* modify sidebar reference in documentation

* fix elements after review on network and subnetwork datasources

* fix fmt on Google provider.go

* modify code with the review

* modify documentation layout order

* fix alphabetic order in provider.go

* fix rebase issue and documentation datasource => data
2017-04-13 13:25:29 -07:00

1.2 KiB

layout page_title sidebar_current description
google Google: google_compute_subnetwork docs-google-datasource-compute-subnetwork Get a subnetwork within GCE.

google_compute_subnetwork

Get a subnetwork within GCE from its name and region.

Example Usage

data "google_compute_subnetwork" "my-subnetwork" {
  name   = "default-us-east1"
  region = "us-east1"
}

Argument Reference

The following arguments are supported:

  • name - The name of the subnetwork.

  • project - (Optional) 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.

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

  • gateway_address - The IP address of the gateway.

  • self_link - The URI of the created resource.