Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added prereqs to README, added labs to 101, initialized 102
  • Loading branch information
Matt Sidwell committed Feb 8, 2019
1 parent dfcbbbc commit ab84928
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
@@ -1,2 +1,19 @@
# terraform_classroom
A set of resources for learning Terraform

## Prerequisites

* [Installation of Terraform](https://learn.hashicorp.com/terraform/getting-started/install.html)
* Make sure you add Terraform to your PATH variable!
* [Unix instructions](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux)
* [Windows instructions](https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows)
* Account with a public cloud provider such as [AWS](https://aws.amazon.com/), [Azure](https://azure.microsoft.com/), or [GCP](https://cloud.google.com/)

## Student Assumptions

These classroom sessions assume you have a beginner's grasp of the following concepts:

* OS command line interaction
* Public cloud providers and resources
* Public cloud provider CLIs
* Git
34 changes: 33 additions & 1 deletion terraform_100/terraform_101/terraform_101.md
Expand Up @@ -6,6 +6,11 @@
- [1.5 Modules](#15-modules)
- [1.6 Terraform State](#16-terraform-state)
- [1.7 Terraform Commands](#17-terraform-commands)
- [Labs](#labs)
- [Exercise 1: Creating a Resource](#exercise-1-creating-a-resource)
- [Exercise 2: Using Variables](#exercise-2-using-variables)
- [Exercise 3: Organizing with .tf Files](#exercise-3-organizing-with-tf-files)
- [Suggested Answers](#suggested-answers)

# Terraform 101

Expand Down Expand Up @@ -219,4 +224,31 @@ when it is run without a specified plan file.
Terraform [apply](https://www.terraform.io/docs/commands/apply.html) performs the actual deployment of resources into a given
environment. By default, it requires user input to confirm a deployment but the
“-autoapprove” flag skips this step. As mentioned above, it will run a plan step
on its own or can be fed a plan file with an expected run set.
on its own or can be fed a plan file with an expected run set.

# Labs

## Exercise 1: Creating a Resource

Create a resource block for your preferred resource provider. Good starting resources are resources with few required parameters like an [AWS S3 bucket](https://www.terraform.io/docs/providers/aws/r/s3_bucket.html) or [Azure resource group](https://www.terraform.io/docs/providers/azurerm/r/resource_group.html).

Test the structure of your .tf file by running ```terraform init``` or ```terraform validate```. Make sure you try actually deploying the resource by using your preferred CLI to login to the resource provider and running ```terraform apply```. For instance, log into the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) using ```aws configure``` or log into the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest#az-login) using ```az login```

Your answer should look similar to the example provided in [section 1.2](#12-resource-blocks)

## Exercise 2: Using Variables

Using the resource block created in the [first exercise](#exercise-1-creating-a-resource), turn all of the hardcoded resource parameters
into variable references. This requires that you declare a variable block for each parameter referenced in this manner.

As before, make sure to test your configuration using a combination of ```terraform init```, ```terraform validate```, and ```terraform apply```. You will be asked to input values for your variables at plan/apply time.

Your resource block should look similar to the resource example in [section 1.3](#13-variable-blocks), and it should be accompanied by a number of variable blocks which look like the example declaration in that same section.

## Exercise 3: Organizing with .tf Files

Using the file contents from the [second exercise]((#exercise-2-using-variables)), create a second .tf file and move your variable declarations to it. Test and apply your configuration and see that it creates the same resource as your answer form the previous exercise.

## Suggested Answers

You can find suggested file structure and contents in the [suggested answers](/suggested_answers/) folder
1 change: 1 addition & 0 deletions terraform_100/terraform_102/terraform102.md
@@ -0,0 +1 @@
#Coming Soon!

0 comments on commit ab84928

Please sign in to comment.