opentofu/examples/aws-two-tier
Valentin Pichard c6beaa7ce8 Fmt all the config files
Signed-off-by: Valentin Pichard <valentin.pichard@corp.ovh.com>
2016-09-22 11:49:09 +00:00
..
main.tf Fmt all the config files 2016-09-22 11:49:09 +00:00
outputs.tf examples directory start 2014-10-13 17:24:25 -07:00
README.md Correct README.md and add missing variable. Correct README.md execution instructions var name and use 'key_name' var as intended in 'aws_key_pair' resource 2015-12-28 12:52:52 +00:00
variables.tf Fmt all the config files 2016-09-22 11:49:09 +00: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 provisioners and a configuration management tool, or by pre-baking configured AMIs with Packer.

This example will also create a new EC2 Key Pair in the specified AWS Region. The key name and path to the public key must be specified via the
terraform command vars.

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.

To run, configure your AWS provider as described in

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

Run with a command like this:

terraform apply -var 'key_name={your_aws_key_name}' \
   -var 'public_key_path={location_of_your_key_in_your_local_machine}'` 

For example:

terraform apply -var 'key_name=terraform' -var 'public_key_path=/Users/jsmith/.ssh/terraform.pub'