2014-10-14 07:18:45 +02:00
|
|
|
# Basic Two-Tier AWS Architecture
|
|
|
|
|
|
|
|
This provides a template for running a simple two-tier architecture on Amazon
|
|
|
|
Web services. The premise is that you have stateless app servers running behind
|
|
|
|
an ELB serving traffic.
|
|
|
|
|
|
|
|
To simplify the example, this intentionally ignores deploying and
|
|
|
|
getting your application onto the servers. However, you could do so either via
|
2015-04-28 13:08:43 +02:00
|
|
|
[provisioners](https://www.terraform.io/docs/provisioners/) and a configuration
|
2014-10-14 07:18:45 +02:00
|
|
|
management tool, or by pre-baking configured AMIs with
|
|
|
|
[Packer](http://www.packer.io).
|
|
|
|
|
|
|
|
After you run `terraform apply` on this configuration, it will
|
|
|
|
automatically output the DNS address of the ELB. After your instance
|
|
|
|
registers, this should respond with the default nginx web page.
|
|
|
|
|
2015-06-01 14:03:05 +02:00
|
|
|
To run, configure your AWS provider as described in
|
2015-06-01 08:45:01 +02:00
|
|
|
|
2015-06-01 14:03:05 +02:00
|
|
|
https://www.terraform.io/docs/providers/aws/index.html
|
2015-06-01 08:45:01 +02:00
|
|
|
|
2015-06-03 15:57:55 +02:00
|
|
|
Run with a command like this:
|
2015-06-01 08:45:01 +02:00
|
|
|
|
2015-06-03 15:57:55 +02:00
|
|
|
```
|
|
|
|
terraform apply -var 'key_name={your_aws_key_name}' \
|
|
|
|
-var 'key_path={location_of_your_key_in_your_local_machine}'`
|
|
|
|
```
|
2015-06-01 08:45:01 +02:00
|
|
|
|
2015-06-03 15:57:55 +02:00
|
|
|
For example:
|
2015-06-01 08:47:14 +02:00
|
|
|
|
2015-06-03 15:57:55 +02:00
|
|
|
```
|
|
|
|
terraform apply -var 'key_name=terraform' -var 'key_path=/Users/jsmith/.ssh/terraform.pem'
|
|
|
|
```
|