Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Creates a regional TCP proxy load balancer for Compute Engine by using target pools and forwarding rules

License

NotificationsYou must be signed in to change notification settings

terraform-google-modules/terraform-google-lb

This is a collection of modules for external TCP/UDP load balancers. The root module is an implementation of passthrough regional TCP Load Balancer for GCE using target pool and forwarding rule. A regional proxy based external load balancer is implemented as a submodlue[modules/regional_proxy_lb/].

Load Balancer Types

Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue.If you haven'tupgraded and need a Terraform0.12.x-compatible version of this module, the last released versionintended for Terraform 0.12.x isv2.3.0.

Usage

Basic usage is as follows:

module"load_balancer" {source="GoogleCloudPlatform/lb/google"version="~> 2.0.0"region=var.regionname="load-balancer"service_port=80target_tags=["allow-lb-service"]network=var.network}module"managed_instance_group" {source="terraform-google-modules/vm/google//modules/mig"version="~> 1.0.0"region=var.regiontarget_size=2hostname="mig-simple"instance_template=module.instance_template.self_linktarget_pools=[module.load_balancer.target_pool]named_ports=[{    name="http"    port=80  }]}

Full functional examples are located in theexamples directory.

Resources Created

Figure 1. Diagram of Terraform resources created by module (in green).Terraform Resources Diagram

Inputs

NameDescriptionTypeDefaultRequired
allowed_ipsThe IP address ranges which can access the load balancer.list(string)
[
"0.0.0.0/0"
]
no
disable_health_checkDisables the health check on the target pool.boolfalseno
firewall_projectName of the project to create the firewall rule in. Useful for shared VPC. Default is var.project.string""no
health_checkHealth check to determine whether instances are responsive and able to do work
object({
check_interval_sec = number
healthy_threshold = number
timeout_sec = number
unhealthy_threshold = number
port = number
request_path = string
host = string
})
{
"check_interval_sec": null,
"healthy_threshold": null,
"host": null,
"port": null,
"request_path": null,
"timeout_sec": null,
"unhealthy_threshold": null
}
no
ip_addressIP address of the external load balancer, if empty one will be assigned.stringnullno
ip_protocolThe IP protocol for the frontend forwarding rule and firewall rule. TCP, UDP, ESP, AH, SCTP or ICMP.string"TCP"no
labelsThe labels to attach to resources created by this module.map(string){}no
nameName for the forwarding rule and prefix for supporting resources.stringn/ayes
networkName of the network to create resources in.string"default"no
projectThe project to deploy to, if not set the default provider project is used.string""no
regionRegion used for GCP resources.stringn/ayes
service_portTCP port your service is listening on.numbern/ayes
session_affinityHow to distribute load. Options areNONE,CLIENT_IP andCLIENT_IP_PROTOstring"NONE"no
target_service_accountsList of target service accounts to allow traffic using firewall rule.list(string)nullno
target_tagsList of target tags to allow traffic using firewall rule.list(string)nullno

Outputs

NameDescription
external_ipThe external ip address of the forwarding rule.
target_poolTheself_link to the target pool resource created.

health_check variable

Thehealth_check variable values are passed on to thegoogle_compute_http_health_check resource. Setting values tonull will usegoogle_compute_http_health_checkdefaults. It takes the following parameters:

NameDescriptionDefaultRequirement
check_interval_secHow often (in seconds) to send a health check5no
healthy_thresholdA so-far unhealthy instance will be marked healthy after this many consecutive successes2no
hostThe value of the host header in the HTTP health check request""no
portThe TCP port number for the HTTP health check request80no
request_pathThe request path of the HTTP health check request/no
timeout_secHow long (in seconds) to wait before claiming failure5no
unhealthy_thresholdA so-far healthy instance will be marked unhealthy after this many consecutive failures2no

About

Creates a regional TCP proxy load balancer for Compute Engine by using target pools and forwarding rules

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors23


[8]ページ先頭

©2009-2025 Movatter.jp