Skip to content

Terraform module creates and manages a Virtual Private Cloud (VPC) network on Google Cloud Platform (GCP). It supports features such as automatic subnet creation, custom routing modes, MTU settings, and Shared VPC configurations. The module also allows for detailed subnet configurations, including secondary IP ranges, logging, and IAM bindings.

License

Notifications You must be signed in to change notification settings

FFerrinho/terraform-google-vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

Name Version
google ~> 6

Providers

Name Version
google 6.16.0

Modules

No modules.

Resources

Name Type
google_compute_network.main resource
google_compute_shared_vpc_host_project.main resource
google_compute_shared_vpc_service_project.main resource
google_compute_subnetwork.main resource
google_compute_subnetwork_iam_binding.main resource

Inputs

Name Description Type Default Required
auto_create_subnetworks If subnetworks should be automatically created. bool true no
delete_default_routes_on_create Whether to delete the default routes created by the VPC network. bool false no
deletion_policy The deletion policy for the Shared VPC Service project attchement. string "ABANDON" no
enable_vpc_host_project Whether to enable the VPC host project. bool false no
iam_bindings IAM bindings
map(object({
region = string
subnetwork = set(string)
members = set(string)
}))
{} no
internal_ipv6_range The range of internal IPv6 addresses managed by the VPC. string null no
mtu The network MTU. number null no
network_firewall_policy_enforcement_order The network firewall policy enforcement order. string null no
project_id The project ID. string n/a yes
routing_mode The network routing mode (default 'GLOBAL'). string "GLOBAL" no
subnets Settings for the subnets
map(object({
ip_cidr_range = string
description = optional(string)
purpose = optional(string)
role = optional(string)
private_ip_google_access = optional(bool)
region = string
stack_type = optional(string)
ipv6_access_type = optional(string)
external_ipv6_prefix = optional(string)

secondary_ip_ranges = optional(list(object({
range_name = string
ip_cidr_range = string
})))

log_config = optional(object({ # https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_subnetwork#nested_log_config
aggregation_interval = optional(string)
flow_sampling = optional(number)
metadata = optional(string)
metadata_fields = optional(set(string))
filter_expr = optional(string) # https://cloud.google.com/vpc/docs/flow-logs#filtering
}))
}))
{} no
vpc_description A description of the VPC. string null no
vpc_name The name of the VPC. string n/a yes
vpc_service_projects A list of service projects to attach the Shared VPC. set(string) null no

Outputs

Name Description
iam_bindings IAM bindings for the subnetworks
network_id The ID of the VPC
subnets_ips The IPs and CIDRs of the subnets
subnets_secondary_ranges The secondary ranges of each subnet
subnetwork_self_links The self links of all subnetworks.
vpc_name The name of the VPC.
vpc_self_link The VPC self link.

About

Terraform module creates and manages a Virtual Private Cloud (VPC) network on Google Cloud Platform (GCP). It supports features such as automatic subnet creation, custom routing modes, MTU settings, and Shared VPC configurations. The module also allows for detailed subnet configurations, including secondary IP ranges, logging, and IAM bindings.

Topics

Resources

License

Stars

Watchers

Forks

Languages