Skip to content

terraform google network

Daniel Lamando edited this page Oct 6, 2021 · 2 revisions

Module Location

To use this module in your Terraform, use the below source value.

module "my_terraform-google-network" {
  source = "s3::https://forto-terrform-modules-demo.s3.eu-west-1.amazonaws.com/terraform-google-network-0.1.0.zip"

  # also any inputs for the module (see below)
}

Module Attributes

Copyright 2019 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Requirements

Name Version
terraform >= 0.13.0
google <4.0,>= 2.12

Providers

No providers.

Modules

Name Source Version
firewall_rules ./modules/firewall-rules n/a
routes ./modules/routes n/a
subnets ./modules/subnets n/a
vpc ./modules/vpc n/a

Resources

No resources.

Inputs

Name Description Type Default Required
network_name The name of the network being created any n/a yes
project_id The ID of the project where this VPC will be created any n/a yes
subnets The list of subnets being created list(map(string)) n/a yes
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
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 bool false no
description An optional description of this resource. The resource must be recreated to modify this field. string "" no
firewall_rules List of firewall rules any [] no
mtu The network MTU. Must be a value between 1460 and 1500 inclusive. If set to 0 (meaning MTU is unset), the network will default to 1460 automatically. number 0 no
routes List of routes being created in this VPC list(map(string)) [] no
routing_mode The network routing mode (default 'GLOBAL') string "GLOBAL" no
secondary_ranges Secondary ranges that will be used in some of the subnets map(list(object({ range_name = string, ip_cidr_range = string }))) {} no
shared_vpc_host Makes this project a Shared VPC host if 'true' (default 'false') bool false no

Outputs

Name Description
network The created network
network_id The ID of the VPC being created
network_name The name of the VPC being created
network_self_link The URI of the VPC being created
project_id VPC project id
route_names The route names associated with this VPC
subnets A map with keys of form subnet_region/subnet_name and values being the outputs of the google_compute_subnetwork resources used to create corresponding subnets.
subnets_flow_logs Whether the subnets will have VPC flow logs enabled
subnets_ids The IDs of the subnets being created
subnets_ips The IPs and CIDRs of the subnets being created
subnets_names The names of the subnets being created
subnets_private_access Whether the subnets will have access to Google API's without a public IP
subnets_regions The region where the subnets will be created
subnets_secondary_ranges The secondary ranges associated with these subnets
subnets_self_links The self-links of subnets being created

Changelog

0.1.0 (2021-10-05)

  • PR #5 - Add a 2nd example module
Initial commit
Copied form https://github.com/terraform-google-modules/terraform-google-network