Git Product home page Git Product logo

gcp-core-network's Introduction

Terraform GCP Network Core Module

maintainer not official release not official release

This module covers the core concepts of a GCP network, it allows you to provision a shared VPC along with many other network componenets that you may need to establish a secure and private connection between your workloads on GCP and Google APIs / internet.

Compatibility

This module is meant for use with Terraform 1.2.3+.

Prerequisites

You need to have a project with google cloud billing enabled. This module will make that project a Host project by enabling shared VPC. You need also to enable the following list of APIs :

  • Compute Engine API ❯❯ compute.googleapis.com
  • Serverless VPC Access API ❯❯ vpcaccess.googleapis.com
  • Cloud DNS API ❯❯ dns.googleapis.com
  • Service Networking API ❯❯ servicenetworking.googleapis.com
  • Service Directory API ❯❯ servicedirectory.googleapis.com
  • Firewall Insights API ❯❯ firewallinsights.googleapis.com
  • Cloud Identity-Aware Proxy API ❯❯ iap.googleapis.com
  • Network Management API ❯❯ networkmanagement.googleapis.com
  • Service Usage API ❯❯ serviceusage.googleapis.com
  • Serverless VPC Access API ❯❯ vpcaccess.googleapis.com

Overview

keyrus_vpc_network_archi_v2.png

File Description
core.tf Provisioning Shared VPC and a subnet
vpc_connector.tf Configuring Serverless VPC Access
firewall.tf Create Firewall rules
nat.tf Configure Cloud Nat
dns.tf Set up a managed zone and create records
pcs.tf Configure Private Service Connect
pca.tf Configure Private Service Access

Dependencies

This work relies on the following official Terraform modules (module call):

Example Usage

module "gcp-core-network" {
  source  = "git::ssh://[email protected]/Abdelwaheb-Hnaien/gcp-core-network.git?ref=0.1.0"

  perimeter = "prod"

  org_prefix = "my-org"

  host_project_id = "shared-xpn-project"

  shared_vpc_name = "my-org-shared-vpc"

  subnets = [
      {
          subnet_name           = "my-org-shared-sub-local"
          subnet_ip             = "10.10.0.0/17"
          subnet_region         = "europe-west1"
          subnet_private_access = "true"
          subnet_flow_logs      = "true"
          description           = "local subnet"
      },
  ]

  private_service_connect_ip = "172.28.144.12"

  cloudsql_ip_range = "172.28.240.0/21"

  memorystore_ip_range = "172.28.252.0/22"

  filestore_ip_range = "172.28.248.0/22"

  vpc_connector_ip_range = "172.28.144.13/28"
}

Inputs

Name Description Type Default Required
host_project_id Host Project ID String n/a yes
perimeter Your Google Cloud environment(example : "prod", "dev", etc.) String n/a yes
org_prefix Your Google Cloud organization prefix (example: "my-org") String n/a yes (at least one subnet)
shared_vpc_name Shared VPC Name String n/a yes
subnets Subnets to be created in the Shared VPC list(map(string)) n/a yes
private_service_connect_ip Private service endpoint String n/a yes
cloudsql_ip_range Private service Connection : Cloud SQL IP Range String n/a yes
memorystore_ip_range Private service Connection : Memorystore IP Range String n/a yes
filestore_ip_range Private service Connection : Filestore IP Range String n/a yes
vpc_connector_ip_range VPC Serverless Access : VPC connector IP String n/a yes

Outputs

Name Description
network The VPC resource being created
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

Contribution

Please feel free to fork the repository and submit a pull request if you think there is an issue or simply if you would like to make this project better.

gcp-core-network's People

Contributors

abdelwaheb-hnaien avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

beninanutshell

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.