You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/examples/google-content-based-load-b...
Riley Karson d2eaa6f8e0
provider/google: Google Cloud content-based load balancing example. (#14448)
9 years ago
..
scripts provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
.gitignore provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
README.md provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
main.tf provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
output.tf provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
terraform.tfvars.example provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago
variables.tf provider/google: Google Cloud content-based load balancing example. (#14448) 9 years ago

README.md

Content Based Load Balancing in Google Cloud

This provides a template for running an HTTP load balancer that distributes traffic to different instances based on the path in the request URL. It is based on the tutorial at https://cloud.google.com/compute/docs/load-balancing/http/content-based-example.

To start, download your credentials from Google Cloud Console; suggested path for downloaded file is ~/.gcloud/Terraform.json.

Optionally update variables.tf to specify a default value for the project_name variable, and check other variables.

After you run terraform apply on this configuration, it will automatically output the public IP address of the load balancer. After your instance registers, the LB should respond with the following at its root:

<h1>www</h1>

And the following at the /video/ url:

<h1>www-video</h1>

To run, configure your Google Cloud provider as described in

https://www.terraform.io/docs/providers/google/index.html

Run with a command like this:

terraform apply \
	-var="region=us-central1" \
	-var="region_zone=us-central1-f" \
	-var="project_name=my-project-id-123" \
	-var="credentials_file_path=~/.gcloud/Terraform.json" \