github.com/candidpartners/terraform@v0.9.5-0.20171005231213-29f5f88820f6/examples/aws-two-tier/README.md (about) 1 # Basic Two-Tier AWS Architecture 2 3 This provides a template for running a simple two-tier architecture on Amazon 4 Web services. The premise is that you have stateless app servers running behind 5 an ELB 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 [provisioners](https://www.terraform.io/docs/provisioners/) and a configuration 10 management tool, or by pre-baking configured AMIs with 11 [Packer](http://www.packer.io). 12 13 This example will also create a new EC2 Key Pair in the specified AWS Region. 14 The key name and path to the public key must be specified via the 15 terraform command vars. 16 17 After you run `terraform apply` on this configuration, it will 18 automatically output the DNS address of the ELB. After your instance 19 registers, this should respond with the default nginx web page. 20 21 To run, configure your AWS provider as described in 22 23 https://www.terraform.io/docs/providers/aws/index.html 24 25 Run with a command like this: 26 27 ``` 28 terraform apply -var 'key_name={your_aws_key_name}' \ 29 -var 'public_key_path={location_of_your_key_in_your_local_machine}' 30 ``` 31 32 For example: 33 34 ``` 35 terraform apply -var 'key_name=terraform' -var 'public_key_path=/Users/jsmith/.ssh/terraform.pub' 36 ```