github.com/fluxrad/terraform@v0.6.4-0.20150906191316-06627ccf39fa/examples/google-two-tier/README.md (about) 1 # Basic Two-Tier Architecture in Google Cloud 2 3 This provides a template for running a simple two-tier architecture on Google Cloud. 4 The premise is that you have stateless app servers running behind 5 a load balancer serving traffic. 6 7 To simplify the example, this intentionally ignores deploying and 8 getting your application onto the servers. However, you could do so either via 9 [startup script](http://terraform.io/docs/providers/google/r/compute_instance.html#metadata_startup_script) or 10 [provisioners](https://www.terraform.io/docs/provisioners/) and a configuration 11 management tool, or by pre-baking configured images with 12 [Packer](https://packer.io/docs/builders/googlecompute.html). 13 14 After you run `terraform apply` on this configuration, it will 15 automatically output the public IP address of the load balancer. 16 After your instance registers, the LB should respond with a simple header: 17 18 ```html 19 <h1>Welcome to instance 0</h1> 20 ``` 21 22 The index may differ once you increase `count` of `google_compute_instance` 23 (i.e. provision more instances). 24 25 To run, configure your Google Cloud provider as described in 26 27 https://www.terraform.io/docs/providers/google/index.html 28 29 Run with a command like this: 30 31 ``` 32 terraform apply \ 33 -var="region=us-central1" \ 34 -var="region_zone=us-central1-f" \ 35 -var="project_name=my-project-id-123" \ 36 -var="account_file_path=~/.gcloud/Terraform.json" \ 37 -var="public_key_path=~/.ssh/gcloud_id_rsa.pub" \ 38 -var="private_key_path=~/.ssh/gcloud_id_rsa" 39 ```