Skip to content

A Terraform module to create and manage a Virtual Private Network (VPC) in Google Cloud https://cloud.google.com/vpc

License

Notifications You must be signed in to change notification settings

mineiros-io/terraform-google-network-vpc

Repository files navigation

Build Status GitHub tag (latest SemVer) Terraform Version Google Provider Version Join Slack

terraform-google-network-vpc

A Terraform module to create a Google Network Vpc on Google Cloud Services (GCP).

This module supports Terraform version 1 and is compatible with the Terraform Google Provider version 5.

This module is part of our Infrastructure as Code (IaC) framework that enables our users and customers to easily deploy and manage reusable, secure, and production-grade cloud infrastructure.

Module Features

A Terraform base module for creating a google_compute_network resources required for building a VPC.

Getting Started

Most basic usage just setting required arguments:

module "terraform-google-network-vpc" {
  source = "github.com/mineiros-io/terraform-google-network-vpc.git?ref=v0.2.0"

  project = "example-project-id"
}

Module Argument Reference

See variables.tf and examples/ for details and use-cases.

Top-level Arguments

Main Resource Configuration

  • project: (Optional string)

    The ID of the project in which the resource belongs. If it is not set, the provider project is used.

  • name: (Optional string)

    The name of the VPC. The name will be used to prefix all associacted resources also.

  • description: (Optional string)

    An optional description of the VPC. The resource must be recreated to modify this field.

  • routing_mode: (Optional string)

    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".

  • delete_default_routes_on_create: (Optional bool)

    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.

    Default is false.

  • auto_create_subnetworks: (Optional bool)

    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.

    Default is false.

  • mtu: (Optional string)

    Maximum Transmission Unit in bytes. The minimum value for this field is 1460 and the maximum value is 1500 bytes.

    Default is "1460".

  • network_firewall_policy_enforcement_order: (Optional string)

    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.

    Default is null.

  • enable_ula_internal_ipv6: (Optional bool)

    Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from Google defined ULA prefix fd20::/20.

    Default is false.

  • internal_ipv6_range: (Optional string)

    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 within the fd20::/20. The operation will fail if the specified /48 is already in use by another resource. If the field is not specified, then a /48 range will be randomly allocated from fd20::/20 and returned via this field."

    Default is null.

Module Configuration

  • module_enabled: (Optional bool)

    Specifies whether resources in the module will be created.

    Default is true.

  • module_depends_on: (Optional list(dependency))

    A list of dependencies. Any object can be assigned to this list to define a hidden external dependency.

    Example:

    module_depends_on = [
      google_project.project_id
    ]

Module Outputs

The following attributes are exported in the outputs of the module:

  • vpc: (object(vpc))

    The outputs of the created VPC.

External Documentation

Google Documentation

Terraform Google Provider Documentation

Module Versioning

This Module follows the principles of Semantic Versioning (SemVer).

Given a version number MAJOR.MINOR.PATCH, we increment the:

  1. MAJOR version when we make incompatible changes,
  2. MINOR version when we add functionality in a backwards compatible manner, and
  3. PATCH version when we make backwards compatible bug fixes.

Backwards compatibility in 0.0.z and 0.y.z version

  • Backwards compatibility in versions 0.0.z is not guaranteed when z is increased. (Initial development)
  • Backwards compatibility in versions 0.y.z is not guaranteed when y is increased. (Pre-release)

About Mineiros

Mineiros is a remote-first company headquartered in Berlin, Germany that solves development, automation and security challenges in cloud infrastructure.

Our vision is to massively reduce time and overhead for teams to manage and deploy production-grade and secure cloud infrastructure.

We offer commercial support for all of our modules and encourage you to reach out if you have any questions or need help. Feel free to email us at [email protected] or join our Community Slack channel.

Reporting Issues

We use GitHub Issues to track community reported issues and missing features.

Contributing

Contributions are always encouraged and welcome! For the process of accepting changes, we use Pull Requests. If you'd like more information, please see our Contribution Guidelines.

Makefile Targets

This repository comes with a handy Makefile. Run make help to see details on each available target.

License

license

This module is licensed under the Apache License Version 2.0, January 2004. Please see LICENSE for full details.

Copyright © 2020-2022 Mineiros GmbH