You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-68Lines changed: 61 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,15 @@ This modules makes it easy to set up a new VPC Network in GCP by defining your n
4
4
5
5
It supports creating:
6
6
7
-
-A Google Virtual Private Network (VPC)
8
-
-Subnets within the VPC
9
-
-Secondary ranges for the subnets (if applicable)
7
+
- A Google Virtual Private Network (VPC)
8
+
- Subnets within the VPC
9
+
- Secondary ranges for the subnets (if applicable)
10
10
11
11
## Compatibility
12
12
13
13
This module is meant for use with Terraform 0.12. If you haven't [upgraded](https://www.terraform.io/upgrade-guides/0-12.html) and need a Terraform 0.11.x-compatible version of this module, the last released version intended for Terraform 0.11.x is [0.8.0](https://registry.terraform.io/modules/terraform-google-modules/network/google/0.8.0).
14
14
15
15
## Usage
16
-
17
16
You can go to the examples folder, however the usage of the module could be like this in your own main.tf file:
18
17
19
18
```hcl
@@ -74,96 +73,90 @@ module "vpc" {
74
73
75
74
Then perform the following commands on the root folder:
76
75
77
-
-`terraform init` to get the plugins
78
-
-`terraform plan` to see the infrastructure plan
79
-
-`terraform apply` to apply the infrastructure build
80
-
-`terraform destroy` to destroy the built infrastructure
76
+
-`terraform init` to get the plugins
77
+
-`terraform plan` to see the infrastructure plan
78
+
-`terraform apply` to apply the infrastructure build
79
+
-`terraform destroy` to destroy the built infrastructure
81
80
82
81
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|auto_create_subnetworks | When set to true, the network is created in 'auto subnet mode' and it will create a subnet for each region automatically across the 10.128.0.0/9 address range. When set to false, the network is created in 'custom subnet mode' so the user can explicitly connect subnetwork resources. |bool |`"false"`| no |
89
-
|delete_default_internet_gateway_routes| If set, ensure that all routes within the network specified whose names begin with 'default-route' and with a next hop of 'default-internet-gateway' are deleted |string |`"false"`| no |
90
-
| description | An optional description of this resource. The resource must be recreated to modify this field. |string |`""`| no |
91
-
|network_name | The name of the network being created |string |n/a |yes|
92
-
|project_id | The ID of the project where this VPC will be created |string |n/a |yes|
93
-
| routes | List of routes being created in this VPC | list(map(string)) |`<list>`| no |
94
-
|routing_mode | The network routing mode (default 'GLOBAL') |string |`"GLOBAL"`| no |
95
-
|secondary_ranges | Secondary ranges that will be used in some of the subnets |object |n/a |yes|
96
-
|shared_vpc_host | Makes this project a Shared VPC host if 'true' (default 'false') |string |`"false"`| no |
97
-
| subnets | The list of subnets being created | list(map(string)) |n/a |yes|
84
+
| Name | Description |Type |Default | Required |
85
+
|------|-------------|:----:|:-----:|:-----:|
86
+
|auto\_create\_subnetworks | When set to true, the network is created in 'auto subnet mode' and it will create a subnet for each region automatically across the 10.128.0.0/9 address range. When set to false, the network is created in 'custom subnet mode' so the user can explicitly connect subnetwork resources. | bool |`"false"`|no|
87
+
|delete\_default\_internet\_gateway\_routes| If set, ensure that all routes within the network specified whose names begin with 'default-route' and with a next hop of 'default-internet-gateway' are deleted |string |`"false"`|no|
88
+
| description | An optional description of this resource. The resource must be recreated to modify this field. |string |`""`| no|
89
+
|network\_name | The name of the network being created |string |n/a |yes |
90
+
|project\_id | The ID of the project where this VPC will be created |string |n/a |yes |
91
+
| routes | List of routes being created in this VPC | list(map(string)) |`<list>`| no|
92
+
|routing\_mode | The network routing mode (default 'GLOBAL') |string |`"GLOBAL"`|no|
93
+
|secondary\_ranges | Secondary ranges that will be used in some of the subnets |object |n/a |yes |
94
+
|shared\_vpc\_host | Makes this project a Shared VPC host if 'true' (default 'false') |string |`"false"`|no|
95
+
| subnets | The list of subnets being created | list(map(string)) | n/a |yes |
The subnets list contains maps, where each object represents a subnet. Each map has the following inputs (please see examples folder for additional references):
120
117
121
-
| Name | Description | Type | Default | Required |
| subnet_name | The name of the subnet being created | string | - | yes |
124
-
| subnet_ip | The IP and CIDR range of the subnet being created | string | - | yes |
125
-
| subnet_region | The region where the subnet will be created | string | - | yes |
126
-
| subnet_private_access | Whether this subnet will have private Google access enabled | string | false | no |
127
-
| subnet_flow_logs | Whether the subnet will record and send flow log data to logging | string | false | no |
118
+
| Name | Description | Type | Default | Required |
119
+
|------|-------------|:----:|:-----:|:-----:|
120
+
| subnet_name | The name of the subnet being created | string | - | yes |
121
+
| subnet_ip | The IP and CIDR range of the subnet being created | string | - | yes |
122
+
| subnet_region | The region where the subnet will be created | string | - | yes |
123
+
| subnet_private_access | Whether this subnet will have private Google access enabled | string | false | no |
124
+
| subnet_flow_logs | Whether the subnet will record and send flow log data to logging | string | false | no |
125
+
| description | The description of the subnet being created | string | null | no |
128
126
129
127
### Route Inputs
130
-
131
-
The routes list contains maps, where each object represents a route. For the next_hop__ inputs, only one is possible to be used in each route. Having two next_hop__ inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):
132
-
133
-
| Name | Description | Type | Default | Required |
| name | The name of the route being created | string | - | no |
136
-
| description | The description of the route being created | string | - | no |
137
-
| tags | The network tags assigned to this route. This is a list in string format. Eg. "tag-01,tag-02" | string | - | yes |
138
-
| destination_range | The destination range of outgoing packets that this route applies to. Only IPv4 is supported | string | - | yes |
139
-
| next_hop_internet | Whether the next hop to this route will the default internet gateway. Use "true" to enable this as next hop | string | - | yes |
140
-
| next_hop_ip | Network IP address of an instance that should handle matching packets | string | - | yes |
141
-
| next_hop_instance | URL or name of an instance that should handle matching packets. If just name is specified "next_hop_instance_zone" is required | string | - | yes |
142
-
| next_hop_instance_zone | The zone of the instance specified in next_hop_instance. Only required if next_hop_instance is specified as a name | string | - | no |
143
-
| next_hop_vpn_tunnel | URL to a VpnTunnel that should handle matching packets | string | - | yes |
144
-
| priority | The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins | string | 1000 | yes |
128
+
The routes list contains maps, where each object represents a route. For the next_hop_* inputs, only one is possible to be used in each route. Having two next_hop_* inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):
129
+
130
+
| Name | Description | Type | Default | Required |
131
+
|------|-------------|:----:|:-----:|:-----:|
132
+
| name | The name of the route being created | string | - | no |
133
+
| description | The description of the route being created | string | - | no |
134
+
| tags | The network tags assigned to this route. This is a list in string format. Eg. "tag-01,tag-02"| string | - | yes |
135
+
| destination_range | The destination range of outgoing packets that this route applies to. Only IPv4 is supported | string | - | yes
136
+
| next_hop_internet | Whether the next hop to this route will the default internet gateway. Use "true" to enable this as next hop | string | - | yes |
137
+
| next_hop_ip | Network IP address of an instance that should handle matching packets | string | - | yes |
138
+
| next_hop_instance | URL or name of an instance that should handle matching packets. If just name is specified "next_hop_instance_zone" is required | string | - | yes |
139
+
| next_hop_instance_zone | The zone of the instance specified in next_hop_instance. Only required if next_hop_instance is specified as a name | string | - | no |
140
+
| next_hop_vpn_tunnel | URL to a VpnTunnel that should handle matching packets | string | - | yes |
141
+
| priority | The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins | string | 1000 | yes |
0 commit comments