This is an example app deployed using terraform.
- Install terraform locally. (Download)
- Create an AWS account. (Create An AWS account)
- Setup authentication to your AWS account via one of the methods described here
- Tip: An easy way to do this is by:
export AWS_ACCESS_KEY_ID=(your access key id) export AWS_SECRET_ACCESS_KEY=(your secret access key) export AWS_DEFAULT_REGION=(your aws region)
- Tip: An easy way to do this is by:
- Clone this repo & navigate to it's root directory
- Initialize terraform:
terraform init
- (Optional) See what changes terraform will make:
terraform plan
- Apply changes:
Note: This will use the default variable, you can use environment specific variables with:
terraform apply
- Once the above command completes it will print something like:
And if you navigate to your EC2 instances page you'll see a new instance starting.
Apply complete! Resources: 1 added, 0 changed, 1 destroyed. Outputs: http_endpoint = http://<ip>:<port>/
- You can verify that the web server is working by running the following command:
Replacing
curl <http_endpoint>
<http_endpoint>
with the output of http_endpoint in the output above. Note: It may take a little while before the web server becomes available - Once complete you can destroy the created resources with:
terraform destroy