在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:terraform-google-modules/terraform-google-network开源软件地址:https://github.com/terraform-google-modules/terraform-google-network开源编程语言:HCL 64.7%开源软件介绍:Terraform Network ModuleThis module makes it easy to set up a new VPC Network in GCP by defining your network and subnet ranges in a concise syntax. It supports creating:
Sub modules are provided for creating individual vpc, subnets, and routes. See the modules directory for the various sub modules usage. CompatibilityThis module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is 2.6.0. UsageYou can go to the examples folder, however the usage of the module could be like this in your own main.tf file: module "vpc" {
source = "terraform-google-modules/network/google"
version = "~> 4.0"
project_id = "<PROJECT ID>"
network_name = "example-vpc"
routing_mode = "GLOBAL"
subnets = [
{
subnet_name = "subnet-01"
subnet_ip = "10.10.10.0/24"
subnet_region = "us-west1"
},
{
subnet_name = "subnet-02"
subnet_ip = "10.10.20.0/24"
subnet_region = "us-west1"
subnet_private_access = "true"
subnet_flow_logs = "true"
description = "This subnet has a description"
},
{
subnet_name = "subnet-03"
subnet_ip = "10.10.30.0/24"
subnet_region = "us-west1"
subnet_flow_logs = "true"
subnet_flow_logs_interval = "INTERVAL_10_MIN"
subnet_flow_logs_sampling = 0.7
subnet_flow_logs_metadata = "INCLUDE_ALL_METADATA"
}
]
secondary_ranges = {
subnet-01 = [
{
range_name = "subnet-01-secondary-01"
ip_cidr_range = "192.168.64.0/24"
},
]
subnet-02 = []
}
routes = [
{
name = "egress-internet"
description = "route through IGW to access internet"
destination_range = "0.0.0.0/0"
tags = "egress-inet"
next_hop_internet = "true"
},
{
name = "app-proxy"
description = "route through proxy to reach app"
destination_range = "10.50.10.0/24"
tags = "app-proxy"
next_hop_instance = "app-proxy-instance"
next_hop_instance_zone = "us-west1-a"
},
]
} Then perform the following commands on the root folder:
Inputs
Outputs
Subnet InputsThe subnets list contains maps, where each object represents a subnet. Each map has the following inputs (please see examples folder for additional references):
Route InputsThe routes list contains maps, where each object represents a route. For the next_hop_* inputs, only one is possible to be used in each route. Having two next_hop_* inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):
RequirementsInstalled Software
Configure a Service AccountIn order to execute this module you must have a Service Account with the following roles:
If you are going to manage a Shared VPC, you must have either:
Enable API'sIn order to operate with the Service Account you must activate the following API on the project where the Service Account was created:
ContributingRefer to the contribution guidelines for information on contributing to this module. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论