Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jharley/terraform-intro
A quick tour of Terraform
https://github.com/jharley/terraform-intro
aws cloudflare introduction-to-terraform learning-by-doing terraform
Last synced: about 1 month ago
JSON representation
A quick tour of Terraform
- Host: GitHub
- URL: https://github.com/jharley/terraform-intro
- Owner: jharley
- License: mit
- Created: 2019-05-27T16:56:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-31T20:02:39.000Z (over 5 years ago)
- Last Synced: 2024-10-12T01:21:00.068Z (2 months ago)
- Topics: aws, cloudflare, introduction-to-terraform, learning-by-doing, terraform
- Homepage:
- Size: 1.42 MB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction to Terraform
This repository is all of the material that was used for [my talk](https://embed.pheedloop.com/dodto19/site/sessions/?id=KzXXQA) at DevOpsDays Toronto 2019.
## Scenario
You -- an intrepid infrastructure engineer -- have been tasked with a green field application project on AWS. The team decided that embracing the codification of infrastructure as well as the applicaiton itself was crucial.
Two crucial problems:
1. Nobody on the team has codified infrastructure before
1. Despite having crafted a bang up whiteboard diagram, going from the picture to code feels like looking over the edge into the abyss.## End Goal
A fairly standard, "three tier" deployment with a load balancer, pool of app servers, and a database. The load balancer is fronted by the CloudFlare CDN for DDoS protection and caching. There is also a bastion host setup for management and maintenance.
![Desired End State](images/milestone-4.png)
## Requirements
* Terraform 0.12.0+ installed
* An AWS account
* I've tried my best to use [free tier](https://aws.amazon.com/free/) eligible or low-cost service optionsThe [AWS provider](https://www.terraform.io/docs/providers/aws/index.html) is currently configured in such a way that it expects your environment to have appropriate [environment variables](https://www.terraform.io/docs/providers/aws/index.html#environment-variables) configured or have setup the AWS CLI with a default or named profile [configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).
Note: you are creating real resources that could have real costs. Make sure you clean up your work and don't leave anything running!
## Usage
There is a branch for each "milestone" of the progression toward the desired end state -- branching removes the need of shuffling the state files around between directories (as was done during the presentation).
Begin by switching to the "milestone-1" branch (`git checkout milestone-1` on the CLI), the README.md file will display a diagram of the intended milestone of that iteration.
You'll then need to execute `terraform init` to pull in the needed providers. With that done, `terraform plan` will show you the resources that need to be created. `terraform apply` will create the resources. Continue moving through the branches in sequence (or skip a few ¯\_(ツ)_/¯) and running `init`, `plan` and `apply` to progress through the updates to the infrastructure after taking a look at the diagram for that milestone.
Remember: when you are finished run `terraform destroy` to clean everything up (to avoid unncessary cloud charges).