2014-08-26 21:50:29 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_compute_network"
|
2015-10-23 14:10:41 +00:00
|
|
|
sidebar_current: "docs-google-compute-network"
|
2014-10-22 03:21:56 +00:00
|
|
|
description: |-
|
|
|
|
Manages a network within GCE.
|
2014-08-26 21:50:29 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# google\_compute\_network
|
|
|
|
|
|
|
|
Manages a network within GCE.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "google_compute_network" "default" {
|
|
|
|
name = "test"
|
|
|
|
ipv4_range = "10.0.0.0/16"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) A unique name for the resource, required by GCE.
|
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
2016-02-15 03:17:55 +00:00
|
|
|
* `ipv4_range` - (Optional) The IPv4 address range that machines in this
|
|
|
|
network are assigned to, represented as a CIDR block. If not
|
|
|
|
set, an auto or custom subnetted network will be created, depending
|
2016-02-22 18:15:02 +00:00
|
|
|
on the value of `auto_create_subnetworks` attribute. This attribute
|
|
|
|
may not be used if `auto_create_subnets` is specified.
|
2016-03-31 10:37:17 +00:00
|
|
|
|
|
|
|
* `auto_create_subnetworks` - (Optional) If set to true, this network
|
2016-02-15 03:17:55 +00:00
|
|
|
will be created in auto subnet mode, and Google will create a
|
|
|
|
subnet for each region automatically.
|
|
|
|
If set to false, and `ipv4_range` is not set, a custom subnetted
|
|
|
|
network will be created that can support `google_compute_subnetwork`
|
2016-02-22 18:15:02 +00:00
|
|
|
resources. This attribute may not be used if `ipv4_range` is specified.
|
2014-08-26 21:50:29 +00:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `name` - The name of the resource.
|
|
|
|
* `ipv4_range` - The CIDR block of this network.
|
|
|
|
* `gateway_ipv4` - The IPv4 address of the gateway.
|