Repo Browser: Virtual Private Cloud (VPC) You need to enable JavaScript to run this app.
Gruntwork Website
Virtual Private Cloud (VPC) Create a Virtual Private Cloud (VPC). Includes multiple subnet tiers, firewall rules, NAT gateways, and VPC peering.
Google VPC Network Modules
This repo contains modules for creating Virtual Private Cloud (VPC) networks on
Google Cloud Platform (GCP) following best practices.
Quickstart
If you want to quickly spin up a VPC Network in GCP, you can run the example that is in the root of this repo. Check out
network-management example documentation
for instructions.
What's in this repo
This repo has the following folder structure:
root : The root folder contains an example of how
to deploy a service-agnostic "management" VPC network in GCP. See network-management
for the documentation.
modules : This folder contains the
main implementation code for this Module, broken down into multiple standalone submodules.
The primary module is:
Inbound traffic to instances in the network is controlled by "access tiers", a pair of subnetwork and
network tags
. By defining an appropriate subnetwork
and tag for an instance, you'll ensure that traffic to and from the instance is properly restricted. See
the Access Tier table
for more details.
There are also several supporting modules that add extra functionality on top of vpc-network
:
network-peering :
Configure peering connections between your networks, allowing you to limit access between environments and reduce
the risk of production workloads being compromised.
project-host-configuration :
Configure your project to be a "host project" whose networks can be shared across multiple projects in the
organization as part of a defense-in-depth security strategy, and to allow service-level billing across different
teams within your organization.
network-firewall :
Configures the firewall rules expected by the vpc-network
module.
examples : This folder contains
examples of how to use the submodules.
test : Automated tests for the submodules
and examples.
What's a VPC?
A Virtual Private Cloud (VPC) network or "network" is a private, isolated
section of your cloud infrastructure. Networks are a virtual version of a physically segregated network that control
connections between your resources and services both on Google Cloud and outside of it.
Networks are global, and a single network can be used for all of your GCP resources across all regions. Subnetworks,
ranges of IP addresses within a single region, can be used to usefully partition your private network IP space.
What's a Module?
A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such
as a database or server cluster. Each Module is written using a combination of Terraform
and scripts (mostly bash) and include automated tests, documentation, and examples. It is maintained both by the open
source community and companies that provide commercial support.
Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse
existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself,
you can leverage the work of the Module community to pick up infrastructure improvements through
a version number bump.
Who maintains this Module?
This Module and its Submodules are maintained by Gruntwork . If you are looking for help or
commercial support, send an email to
support@gruntwork.io .
Gruntwork can help with:
Setup, customization, and support for this Module.
Modules and submodules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous
integration.
Modules and Submodules that meet compliance requirements, such as HIPAA.
Consulting & Training on AWS, Terraform, and DevOps.
How do I contribute to this Module?
Contributions are very welcome! Check out the Contribution Guidelines
for instructions.
How is this Module versioned?
This Module follows the principles of Semantic Versioning . You can find each new release, along
with the changelog, in the Releases Page .
During initial development, the major version will be 0 (e.g., 0.x.y
), which indicates the code does not yet have a
stable API. Once we hit 1.0.0
, we will make every effort to maintain a backwards compatible API and use the MAJOR,
MINOR, and PATCH versions on each release to indicate any incompatibilities.
License
Please see LICENSE for how the code in
this repo is licensed.
Copyright © 2019 Gruntwork, Inc.
Questions? Ask away. We're here to talk about our services, answer any questions, give advice, or just to chat.
Ready to hand off the Gruntwork? "https://cdn.gruntwork.io/gruntwork-website/"
{"index":{"js":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.c7884255553b53fbca3a.js","map":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.1b14c1b7d19f1f5eb35d6e118e838255.map"},"styles":{"css":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.f22938926651ddec7c49.css","js":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.e782420e74a20dcb8691.js","map":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.d5e2af49807c6ca33f8367d621ece507.map"},"vendors":{"css":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.29f7d0366a0978763f96.css","js":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.fa8174a130797d75d12c.js","map":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.57243d94deeeb29d5061288a338b4eb6.map"}}
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"ce28875275b9b75c4ae48de63634a74e0863691f"}]},{"name":".gitignore","path":".gitignore","sha":"1126bffabd62465b897cca526c36429656704cb8"},{"name":".img","children":[{"name":"management-network-diagram.png","path":".img/management-network-diagram.png","sha":"7084e6a1831058c01928f0160cf04797cc1b9a91"}]},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"1b848ef901cc69bf0207a6715cab173e30f6f95d"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"e47d027ad15beb415e4f619397c8a3ef1ccd2497"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"3ac0e4a29adec32a8b94f1abedf9e591b04a35dc"},{"name":"LICENSE","path":"LICENSE","sha":"261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64"},{"name":"NOTICE","path":"NOTICE","sha":"813ca2c22c098d024867e5c57b0ca49c4c420a9b"},{"name":"README.md","path":"README.md","sha":"66e03627258ee12c51105febb31c659fcdab7292","toggled":true},{"name":"examples","children":[{"name":"bastion-host","children":[{"name":"README.md","path":"examples/bastion-host/README.md","sha":"a7ebe42339db822080f349ea27804837fdde0060"},{"name":"main.tf","path":"examples/bastion-host/main.tf","sha":"894c65036bb1569f505314b3e9fcf60a3244f77b"},{"name":"outputs.tf","path":"examples/bastion-host/outputs.tf","sha":"6fbd565bffc859b7f5fc492fb780ac028150232c"},{"name":"variables.tf","path":"examples/bastion-host/variables.tf","sha":"86c1eb710845f86955ad36da35ad79b0c5a312d2"}]},{"name":"network-host-application","children":[{"name":"README.md","path":"examples/network-host-application/README.md","sha":"ef618011892eb8ddfd0e92c818fef6fb7f3543db"},{"name":"main.tf","path":"examples/network-host-application/main.tf","sha":"782db016f30638255128fc7b505d51d1203f2314"},{"name":"outputs.tf","path":"examples/network-host-application/outputs.tf","sha":"6596252d1eeeb7aae16019d8e8dbaf0f9d4c0674"},{"name":"variables.tf","path":"examples/network-host-application/variables.tf","sha":"25286e9a9d64b64025faf8a2cd1ffda01293c554"}]},{"name":"network-management","children":[{"name":"README.md","path":"examples/network-management/README.md","sha":"2ed8ad7399d1b0b4e4e0ad494ee12dcc0b7cc189"},{"name":"main.tf","path":"examples/network-management/main.tf","sha":"79d1008b316aa7dbf49ea29ff8e9b3aa2a2436dd"},{"name":"outputs.tf","path":"examples/network-management/outputs.tf","sha":"8fd8feb360443243cd84781d27b5542e779ae74f"},{"name":"variables.tf","path":"examples/network-management/variables.tf","sha":"b80f3cb47a333ca47a557815b2167aa14561c349"}]}]},{"name":"main.tf","path":"main.tf","sha":"e7e4b973e59aa409b05bde904de8d77ef81a9d4e"},{"name":"modules","children":[{"name":"bastion-host","children":[{"name":"README.md","path":"modules/bastion-host/README.md","sha":"1a705283375fa3924a1b0a5945a7458beda832ee"},{"name":"main.tf","path":"modules/bastion-host/main.tf","sha":"0d0b2d6dbc3c5e6ce0745a7ec5425f5debee1900"},{"name":"outputs.tf","path":"modules/bastion-host/outputs.tf","sha":"5cde56f6169f4acc6b6775cf59833239177b0f60"},{"name":"variables.tf","path":"modules/bastion-host/variables.tf","sha":"c3a675b8924721f4f593385bc9c6ff8027f7f35b"}]},{"name":"network-firewall","children":[{"name":"README.md","path":"modules/network-firewall/README.md","sha":"38d34f6f8a0644488cd1e7afe6ecc58e88f672b2"},{"name":"main.tf","path":"modules/network-firewall/main.tf","sha":"65c125fb4a49cd1b85938a6fe5f5502dc4842b61"},{"name":"outputs.tf","path":"modules/network-firewall/outputs.tf","sha":"ed4da00b5a4b79ff17f60bc05c64af1b12bd31dd"},{"name":"variables.tf","path":"modules/network-firewall/variables.tf","sha":"507ced8a50b3a7691d64dbca763e9769b1694c87"}]},{"name":"network-peering","children":[{"name":"README.md","path":"modules/network-peering/README.md","sha":"cd27cd135b382acae99b25aa0d11c5a81d3d57bb"},{"name":"main.tf","path":"modules/network-peering/main.tf","sha":"b7f4fac3c04116eeabe1bc36611a9571622cee3a"},{"name":"variables.tf","path":"modules/network-peering/variables.tf","sha":"7f872708771a2347dfa5e3108ce45b668ec106c5"}]},{"name":"project-host-configuration","children":[{"name":"README.md","path":"modules/project-host-configuration/README.md","sha":"abb1c6761f3e6c3dd51f390ffa2632f141cf72fa"},{"name":"main.tf","path":"modules/project-host-configuration/main.tf","sha":"c0d45540f77b6743f2ebff60e211b1154604279f"},{"name":"variables.tf","path":"modules/project-host-configuration/variables.tf","sha":"eaa9516f0198577981bb5b0029996ae23ee31eab"}]},{"name":"vpc-network","children":[{"name":"README.md","path":"modules/vpc-network/README.md","sha":"8c7e00072ffadbfcdadcc1ae5381b3279f955fc6"},{"name":"main.tf","path":"modules/vpc-network/main.tf","sha":"4444723420687d91cde07d8f489ad5d5bf733d14"},{"name":"outputs.tf","path":"modules/vpc-network/outputs.tf","sha":"b2e28d602191155dda8ba96f330f4e52ea4aab50"},{"name":"variables.tf","path":"modules/vpc-network/variables.tf","sha":"ce4309ce4ce1cee61d85c3cd23897d15034bafd0"}]}]},{"name":"outputs.tf","path":"outputs.tf","sha":"8fd8feb360443243cd84781d27b5542e779ae74f"},{"name":"test","children":[{"name":"bastion_host_test.go","path":"test/bastion_host_test.go","sha":"6bf7416b5bb36f5c71516fc51f6af7e5a98a5264"},{"name":"go.mod","path":"test/go.mod","sha":"de8a9e0beb8369caeabf007ba08ef9f322d83e12"},{"name":"go.sum","path":"test/go.sum","sha":"b7a5f8e6b5bb5e5f4ce861fc1f653adc12c72cd4"},{"name":"management_network_test.go","path":"test/management_network_test.go","sha":"a1ac8bbf02e80ee1c8b90a75313e3ad979104f74"},{"name":"network_helpers.go","path":"test/network_helpers.go","sha":"cd3bebf46b8ff0def73e5b8ac9fb8ec2ad15812a"},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"8bb91f2fffba4836b7aba30d32be30d551f6530a"},{"name":"validation","children":[{"name":"validate_all_modules_and_examples_test.go","path":"test/validation/validate_all_modules_and_examples_test.go","sha":"74c928d0cbc2914e5cd708277bd857cb2375b660"}]}]},{"name":"variables.tf","path":"variables.tf","sha":"b80f3cb47a333ca47a557815b2167aa14561c349"}]},"detailsContent":"<p><a href=\"https://gruntwork.io/?ref=repo_google_network\" class=\"preview__body--description--blue\" target=\"_blank\"><img src=\"https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg\" alt=\"Maintained by Gruntwork.io\" class=\"preview__body--diagram\"></a>\n<a href=\"#open_modal\" class=\"preview__body--description--blue\"><img src=\"https://img.shields.io/github/tag/gruntwork-io/terraform-google-network.svg?label=latest\" alt=\"GitHub tag (latest SemVer)\" class=\"preview__body--diagram\"></a>\n<img src=\"https://img.shields.io/badge/tf-%3E%3D1.0.x-blue.svg\" alt=\"Terraform Version\" class=\"preview__body--diagram\"></p>\n<h1 class=\"preview__body--title\" id=\"google-vpc-network-modules\">Google VPC Network Modules</h1><div class=\"preview__body--border\"></div><p>This repo contains modules for creating <a href=\"https://cloud.google.com/vpc/docs/vpc\" class=\"preview__body--description--blue\" target=\"_blank\">Virtual Private Cloud (VPC) networks</a> on\nGoogle Cloud Platform (GCP) following best practices.</p>\n<h2 class=\"preview__body--subtitle\" id=\"quickstart\">Quickstart</h2>\n<p>If you want to quickly spin up a VPC Network in GCP, you can run the example that is in the root of this repo. Check out\n<a href=\"/repos/v0.9.0/terraform-google-network/examples/network-management\" class=\"preview__body--description--blue\">network-management example documentation</a>\nfor instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-in-this-repo\">What's in this repo</h2>\n<p>This repo has the following folder structure:</p>\n<ul>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network\" class=\"preview__body--description--blue\">root</a>: The root folder contains an example of how\nto deploy a service-agnostic "management" VPC network in GCP. See <a href=\"/repos/v0.9.0/terraform-google-network/examples/network-management\" class=\"preview__body--description--blue\">network-management</a>\nfor the documentation.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/modules\" class=\"preview__body--description--blue\">modules</a>: This folder contains the\nmain implementation code for this Module, broken down into multiple standalone submodules.</p>\n<p>The primary module is:</p>\n<ul>\n<li><a href=\"/repos/v0.9.0/terraform-google-network/modules/vpc-network\" class=\"preview__body--description--blue\">vpc-network</a>: Launch a\nsecure VPC network on GCP.</li>\n</ul>\n<p>Inbound traffic to instances in the network is controlled by "access tiers", a pair of subnetwork and\n<a href=\"https://cloud.google.com/vpc/docs/add-remove-network-tags\" class=\"preview__body--description--blue\" target=\"_blank\">network <code>tags</code></a>. By defining an appropriate subnetwork\nand tag for an instance, you'll ensure that traffic to and from the instance is properly restricted. See\n<a href=\"/repos/v0.9.0/terraform-google-network/modules/vpc-network#access-tier\" class=\"preview__body--description--blue\">the Access Tier table</a>\nfor more details.</p>\n<p>There are also several supporting modules that add extra functionality on top of <code>vpc-network</code>:</p>\n<ul>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/modules/network-peering\" class=\"preview__body--description--blue\">network-peering</a>:\nConfigure peering connections between your networks, allowing you to limit access between environments and reduce\nthe risk of production workloads being compromised.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/modules/project-host-configuration\" class=\"preview__body--description--blue\">project-host-configuration</a>:\nConfigure your project to be a "host project" whose networks can be shared across multiple projects in the\norganization as part of a defense-in-depth security strategy, and to allow service-level billing across different\nteams within your organization.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/modules/network-firewall\" class=\"preview__body--description--blue\">network-firewall</a>:\nConfigures the firewall rules expected by the <code>vpc-network</code> module.</p>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/examples\" class=\"preview__body--description--blue\">examples</a>: This folder contains\nexamples of how to use the submodules.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.9.0/terraform-google-network/test\" class=\"preview__body--description--blue\">test</a>: Automated tests for the submodules\nand examples.</p>\n</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-vpc\">What's a VPC?</h2>\n<p>A <a href=\"https://cloud.google.com/vpc/docs/vpc\" class=\"preview__body--description--blue\" target=\"_blank\">Virtual Private Cloud (VPC) network</a> or "network" is a private, isolated\nsection of your cloud infrastructure. Networks are a virtual version of a physically segregated network that control\nconnections between your resources and services both on Google Cloud and outside of it.</p>\n<p>Networks are global, and a single network can be used for all of your GCP resources across all regions. Subnetworks,\nranges of IP addresses within a single region, can be used to usefully partition your private network IP space.</p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-module\">What's a Module?</h2>\n<p>A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such\nas a database or server cluster. Each Module is written using a combination of <a href=\"https://www.terraform.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a>\nand scripts (mostly bash) and include automated tests, documentation, and examples. It is maintained both by the open\nsource community and companies that provide commercial support.</p>\n<p>Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse\nexisting code that has been proven in production. And instead of maintaining all that infrastructure code yourself,\nyou can leverage the work of the Module community to pick up infrastructure improvements through\na version number bump.</p>\n<h2 class=\"preview__body--subtitle\" id=\"who-maintains-this-module\">Who maintains this Module?</h2>\n<p>This Module and its Submodules are maintained by <a href=\"http://www.gruntwork.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Gruntwork</a>. If you are looking for help or\ncommercial support, send an email to\n<a href=\"mailto:support@gruntwork.io?Subject=GKE%20Module\" class=\"preview__body--description--blue\" target=\"_blank\">support@gruntwork.io</a>.</p>\n<p>Gruntwork can help with:</p>\n<ul>\n<li>Setup, customization, and support for this Module.</li>\n<li>Modules and submodules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous\nintegration.</li>\n<li>Modules and Submodules that meet compliance requirements, such as HIPAA.</li>\n<li>Consulting & Training on AWS, Terraform, and DevOps.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-i-contribute-to-this-module\">How do I contribute to this Module?</h2>\n<p>Contributions are very welcome! Check out the <a href=\"/repos/v0.9.0/terraform-google-network/CONTRIBUTING.md\" class=\"preview__body--description--blue\">Contribution Guidelines</a>\nfor instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-is-this-module-versioned\">How is this Module versioned?</h2>\n<p>This Module follows the principles of <a href=\"http://semver.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Semantic Versioning</a>. You can find each new release, along\nwith the changelog, in the <a href=\"#open_modal\" class=\"preview__body--description--blue\">Releases Page</a>.</p>\n<p>During initial development, the major version will be 0 (e.g., <code>0.x.y</code>), which indicates the code does not yet have a\nstable API. Once we hit <code>1.0.0</code>, we will make every effort to maintain a backwards compatible API and use the MAJOR,\nMINOR, and PATCH versions on each release to indicate any incompatibilities.</p>\n<h2 class=\"preview__body--subtitle\" id=\"license\">License</h2>\n<p>Please see <a href=\"/repos/v0.9.0/terraform-google-network/LICENSE\" class=\"preview__body--description--blue\">LICENSE</a> for how the code in\nthis repo is licensed.</p>\n<p>Copyright © 2019 Gruntwork, Inc.</p>\n","repoName":"terraform-google-network","repoRef":"v0.9.0","serviceDescriptor":{"serviceName":"Virtual Private Cloud (VPC)","serviceRepoName":"terraform-google-network","serviceRepoOrg":"gruntwork-io","cloudProviders":["gcp"],"description":"Create a Virtual Private Cloud (VPC). Includes multiple subnet tiers, firewall rules, NAT gateways, and VPC peering.","imageUrl":"grunt.png","licenseType":"open-source","technologies":["Terraform"],"compliance":[],"tags":[""]},"serviceCategoryName":"Networking","fileName":"README.md","filePath":"","title":"Repo Browser: Virtual Private Cloud (VPC)","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}