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-two-tier
Christian Berendt 6e92813daa
examples: unify the configuration file syntax
11 years ago
..
.gitignore google: Add example of two-tier app 11 years ago
README.md google: Add example of two-tier app 11 years ago
main.tf examples: unify the configuration file syntax 11 years ago
output.tf examples: unify the configuration file syntax 11 years ago
terraform.tfvars.example google: Add example of two-tier app 11 years ago
variables.tf examples: unify the configuration file syntax 11 years ago

README.md

Basic Two-Tier Architecture in Google Cloud

This provides a template for running a simple two-tier architecture on Google Cloud. The premise is that you have stateless app servers running behind a load balancer serving traffic.

To simplify the example, this intentionally ignores deploying and getting your application onto the servers. However, you could do so either via startup script or provisioners and a configuration management tool, or by pre-baking configured images with Packer.

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 a simple header:

<h1>Welcome to instance 0</h1>

The index may differ once you increase count of google_compute_instance (i.e. provision more instances).

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="account_file_path=~/.gcloud/Terraform.json" \
	-var="public_key_path=~/.ssh/gcloud_id_rsa.pub" \
	-var="private_key_path=~/.ssh/gcloud_id_rsa"