Terraform module to create network resource on google.
This Terraform module provisions a Google Cloud VPC with customizable options.
This Terraform module creates an GCP Virtual Private Cloud (VPC) along with additional configuration options.
To get started, make sure you have configured your GCP provider. You can use the following code as a starting point:
module "vpc" {
source = "git::https://github.com/slovink/terraform-google-network.git?ref=v1.0.0"
name = "ops"
environment = "test"
routing_mode = "REGIONAL"
mtu = 1500
network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
}
Replace the 'source' attribute with the actual path to the module in your project.
For detailed examples on how to use this module, please refer to the Examples directory within this repository.
This Terraform module is provided under the MIT License. Please see the LICENSE file for more details.
Your Name Replace MIT and slovink with the appropriate license and your information. Feel free to expand this README with additional details or usage instructions as needed for your specific use case.
Name | Version |
---|---|
terraform | >=1.7.4 |
>= 3.50, < 5.0 |
Name | Version |
---|---|
>= 3.50, < 5.0 |
Name | Source | Version |
---|---|---|
labels | git::https://github.com/slovink/terraform-google-labels.git | v1.0.0 |
Name | Type |
---|---|
google_compute_network.vpc | resource |
google_client_config.current | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
auto_create_subnetworks | (Optional) 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. | bool |
false |
no |
delete_default_routes_on_create | (Optional) If set to true, 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. | bool |
true |
no |
description | (Optional) An optional description of the VPC. The resource must be recreated to modify this field.Default is ''. | string |
"" |
no |
enable_ula_internal_ipv6 | (Optional) Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. | bool |
false |
no |
environment | Environment name | string |
"" |
no |
internal_ipv6_range | (Optional) When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. | string |
null |
no |
label_order | Label order, e.g. name ,application . |
list(any) |
[ |
no |
managedby | ManagedBy, eg 'slovink'. | string |
"slovink" |
no |
module_enabled | A boolean flag to enable/disable vpc. | bool |
true |
no |
mtu | (Optional) Maximum Transmission Unit in bytes. The minimum value for this field is 1460 and the maximum value is 1500 bytes. Default is '1460'. | string |
1460 |
no |
name | (Optional) The name of the VPC. The name will be used to prefix all associacted resources also. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression "a-z?" which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. Default is "main". | string |
"" |
no |
network_enabled | A boolean flag to enable/disable vpc. | bool |
true |
no |
network_firewall_policy_enforcement_order | (Optional) Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is AFTER_CLASSIC_FIREWALL. Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL | string |
"AFTER_CLASSIC_FIREWALL" |
no |
repository | Terraform current module repo | string |
"https://github.com/slovink/terraform-google-network" |
no |
routing_mode | (Optional) The network-wide routing mode to use. If set to 'REGIONAL', this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set to 'GLOBAL', this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are 'REGIONAL' and 'GLOBAL'. Default is 'REGIONAL'. | string |
"REGIONAL" |
no |
Name | Description |
---|---|
gateway_ipv4 | The IPv4 address of the gateway |
self_link | The URI of the created resource |
vpc_id | The outputs of the created VPC. |