• Stars
    star
    558
  • Rank 79,819 (Top 2 %)
  • Language HCL
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Exercise files for my Pluralsight course

Getting-Started-Terraform

Welcome to Terraform - Getting Started. These exercise files are meant to accompany my course on Pluralsight. The course was developed using version 1.0.8 of Terraform. Since the GA of version 1.0, HashiCorp has committed to no breaking changes until version 2.0. All the exercises in this course should be valid as long as you are using Terraform in the 1.X version family. The modules and providers in this course have no such guarantee, so I have pinned the version where applicable.

This version of the course is significantly different from the previous version. If you're looking for the exercise files for the older course, they are available on the pre-1.0 branch of this repository. Those files should work with version 0.14.3 of Terraform, but no guarantees on anything newer.

Using the files

In the course, you are given a Terraform configuration for a basic web application from someone else on the Globomantics team. We are going to make a copy of this configuration and modify it over the length of the course. The base_web_app directory has the basic web app configuration, which we will copy over to the globo_web_app and start making alterations.

As we progress through the modules, you will be challenged to make updates to the files in globo_web_app to meet the evolving needs and requirements of the web application infrastructure. The completed solution for each module is in the mX_solution directories. I recommend trying to first write the solution yourself, and then checking your answer against what you see in the solution file.

At the beginning of module three, we will hardcode our AWS keys into the configuration. You would not do this in any kind of scenario! I am trying to illustrate a point in the course. Please do not commit your AWS keys to source control. Some of us (me) have done this in the past and felt very silly. We will move these keys into environment variables in module four, and they shall never again be hardcoded anywhere.

The suggested commands for each module are in the commands directory. You can run these commands to get through the exercises, but I also encourage you to experiment and try things out for yourself.

AWS Environment

You will need access to an AWS environment with permissions to create resources in EC2, S3, and IAM. I recommend creating a throwaway account just for this course. The exercises have been tested with AWS region us-east-1. The input variable aws_region has us-east-1 set as the default, but you can supply a different region if you prefer. Generally, the exercises should work in any region that has at least three availability zones and an Amazon Linux 2 AMI.

You will need to generate an AWS access key to run through the exercises. You can do this through the IAM console in a browser (hint: it's under security credentials for your user) by following the official AWS docs. I'd recommend assigning the AdministratorAccess policy to your user to give you permissions to do everything in the account. Also, enable 2FA for the user account!

Line Endings

An issue I have discovered from time to time is that Terraform doesn't much like the Windows style of ending a line with both a Carriage Return (CR) and a Line Feed (LF), commonly referred to as CRLF. If you are experiencing strange parsing issues, change the line ending to be Line Feed (LF) only. In VS Code this can be down by clicking on the CRLF in the lower right corner and changing it to LF. This primarily affects template files or scripts being sent to a Linux machine for processing.

MONEY!!!

A gentle reminder about cost. The course will have you creating resources in AWS. Some of the resources are not going to be 100% free. I have tried to use the Free-tier when possible, but in some cases I have elected to use a larger size EC2 instance to demonstrate the possibilities with multiple environments.

When you complete an exercise in the course, you can easily tear down the deployed infrastructure using terraform destroy. Just run that command and approve the destruction to remove all resources from AWS. Before you start the next module, run terraform apply again and you should be right where you started. Isn't infrastructure automation amazing?!

Certification

HashiCorp has released the Terraform Certified Associate certification. You might be wondering if this course fully prepares you for the cert. It does not. Taking this course along with the Deep Dive - Terraform course on Pluralsight will meet most of the learning objectives for the certification, but there is no substitute for running the software on your own and hacking away.

I have coauthored a certification guide which you can find on Leanpub. This is an unofficial guide, but I believe in concert with the Pluralsight courses you will be in a good position to sit the exam.

Conclusion

I hope you enjoy taking this course as much as I did creating it. I'd love to hear feedback and suggestions for revisions. Find me on Twitter (@ned1313) or add an issue to this repository.

Thanks and happy automating!

Ned

More Repositories

1

terraform-tuesdays

Demo files for various Terraform Tuesday Examples
HCL
385
star
2

Deep-Dive-Terraform

Exercise files for my Pluralsight course.
HCL
185
star
3

Implementing-Terraform-on-Microsoft-Azure

Code examples for the Pluralsight course Implementing Terraform on Microsoft Azure
HCL
135
star
4

Implementing-Terraform-on-AWS

Exercise files for the Pluralsight course
HCL
64
star
5

Getting-Started-Vault

Shell
59
star
6

Hashicorp-Certified-Vault-Associate-Getting-Started

Exercise files for my course Hashicorp Certified Vault Associate: Getting Started
Shell
40
star
7

Managing-HashiCorp-Vault

HCL
25
star
8

ado-labs-github-actions

Demo files for the Azure DevOps Labs episode about GitHub Actions and Terraform
HCL
21
star
9

CKA-Study-Guide

My personal study guide for the CKA
20
star
10

vault-oidc-github-actions

A demonstration of using GitHub OIDC to authenticate to HashiCorp Vault
HCL
20
star
11

Hashicorp-Certified-Vault-Associate-Vault-Management

Exercise files for my Pluralsight course.
Shell
18
star
12

Terraform-FotD

Terraform Function of the Day
HCL
18
star
13

Azure-Identity-Management

PowerShell
17
star
14

Azure-Information-Protection

PowerShell
17
star
15

vault-policy-testing

Python
16
star
16

advanced-networking-on-aws

Exercise files for the Advanced Networking on AWS course on Pluralsight
Shell
16
star
17

Installing-and-Configuring-HashiCorp-Vault

HCL
15
star
18

Configuring-and-Managing-Microsoft-Azure-Key-Vault

I really feel like the name says it all.
PowerShell
15
star
19

learning-opa-and-terraform

A Tutorial on Using Open Policy Agent with Terraform
Open Policy Agent
14
star
20

hashitalks-aks-pod-id

HCL
11
star
21

PowerShellHelperScripts

Random Helper Scripts in PowerShell
PowerShell
10
star
22

ado-labs-validate-iac

Demo files to accompany the Microsoft Azure DevOps Labs presentation.
HCL
10
star
23

Getting-Started-with-Terraform-Cloud

HCL
10
star
24

Implement-an-AVD-Infrastructure

Exercise files to accompany my Pluralsight course
HCL
9
star
25

Configuring-Encryption-for-Data-at-Rest-in-Microsoft-Azure

PowerShell
8
star
26

azure-swa-hugo-blog

Code to deploy and maintain an Azure Static Webapp running a static web site generated with Hugo and GitHub Actions.
HTML
7
star
27

terraform-azuread-github_oidc

Terraform module to create an Azure AD application, service principal, and federated identity for GitHub-based OIDC authentication.
HCL
7
star
28

terraform-tfe-org-factory

Terraform module to create Terraform Cloud organizations, workspaces, and teams.
HCL
6
star
29

Vault-on-ACI

An implementation of HashiCorp Vault on Azure Container Instances
HCL
6
star
30

Configure-and-Manage-Key-Vault

Exercise files for my Pluralsight course Configure and Manage Key Vault, part of the AZ-500 certification prep.
PowerShell
6
star
31

hashitalks-2023-boundary

Demo code for HashiTalks 2023 Boundary Presentation
HCL
6
star
32

tfc-vault-oidc-example

Example of using workload identity in Terraform Cloud with Vault
HCL
5
star
33

AWS-SysOps-Admin-Assoc-Troubleshoot-Network

Companion exercise files for my Pluralsight course
Shell
5
star
34

Terraforming-with-GitHub-Actions

GitHub repo for my Festive Tech Calendar entry
HCL
4
star
35

terraform-vm

Shell
4
star
36

Configure-Security-Policies

Code examples to accompany the Pluralsight course.
Shell
4
star
37

github-simple-oidc-testing

A simple example of using OIDC with GitHub Actions and Microsoft Azure
HCL
4
star
38

AWS-SysOps-Admin-Assoc-DNS-and-Content-Delivery

Exercise Files for the associated Pluralsight course
Shell
4
star
39

Networking-in-Public-Cloud-Deployments

Code examples for the Networking in Public Cloud Deployments lecture - March 2020
HCL
4
star
40

env0-app-example

HCL
4
star
41

vault-fridays

Shell
3
star
42

tt-folder-example

Folder based multi environment example
HCL
3
star
43

tt-repo-example-prod

Example terraform deployment using repositories per environment
HCL
3
star
44

tt-branch-example

Branch based multi environment example
HCL
3
star
45

terraform-vdc-demo

HCL
3
star
46

terraform-mmsmoa-2019

Demonstration example files for the MMS MOA conference
HCL
3
star
47

dot-net-liverpool

Demo files for Dot Net Liverpool talk
HCL
3
star
48

terraform-azuread-serviceprincipal

Terraform module for creating service principals in Azure AD.
HCL
3
star
49

github-oidc-azure-setup

Setup repository for configuring GitHub Actions and OIDC
HCL
2
star
50

AzureSpeechToTextPowershell

PowerShell Scripts for Azure Speech to Text API
PowerShell
2
star
51

vault-aws-auth

Demo of using AWS IAM auth with HashiCorp Vault
2
star
52

Monitor-Security-with-Azure-Security-Center

Exercise files for my Pluralsight course of same name.
PowerShell
2
star
53

Plan-and-Implement-User-Environments-and-Apps-on-AVD

HCL
2
star
54

Plan-and-Implement-Identity-and-Security-on-AVD

Scripts for my Pluralsight course
HCL
2
star
55

Monitor-and-Maintain-an-AVD-Infrastructure

Repository for my Plurasight course of the same name
HCL
2
star
56

github-oidc-testing

Testing repo for GitHub OIDC to Azure AD
HCL
2
star
57

Configuring-Azure-VM-Clusters-Using-Terraform

Public repository for my A Cloud Guru course
HCL
2
star
58

terraform-cloudinit-native

A Terraform module to generate cloud init file natively without a provider plugin or data source.
HCL
1
star
59

env0-ci-example

Example code for a CI process involving env0
HCL
1
star
60

ansible-playbook-nginx

Ansible playbook to install NGINX locally
Jinja
1
star
61

terraform-azurerm-swapodcast

A Terraform module meant to deploy an Azure Static Web App to host a podcast.
HCL
1
star
62

tt-repo-example-dev

Example terraform deployment using repositories per environment
HCL
1
star
63

vscode-mms2019

Code examples for the VS Code presentation at MMS MOA 2019
JavaScript
1
star
64

IaCTerraformDemo

Files for an Infrastructure as Code demo using Terraform
HCL
1
star
65

env0-terraform-tutorial

Repository to accompany the blog post
HCL
1
star
66

tt-repo-example-staging

Example terraform deployment using repositories per environment
HCL
1
star
67

functional-iac-testing

HCL
1
star
68

azure-philly-aks

Examples for the Azure Philly Meetup
1
star
69

TFSVMDeploy

PowerShell
1
star
70

azure-advent-aks

HCL
1
star
71

terraformProjects

Various Terraform Projects I am kicking around
HCL
1
star
72

AWS-UG-Terraform

HCL
1
star
73

hashiconf-global-opa

Example code for using OPA with Terraform.
Open Policy Agent
1
star
74

Operating-Azure-Stack

Exercise Files to go with the Pluralsight Course
PowerShell
1
star
75

robusta-on-aks

Demo to install Robusta on AKS with Prometheus
HCL
1
star
76

terraform-azurerm-networkdatasource

Data source module for Azure Networking
HCL
1
star
77

aks-storage-testing

FIO testing for different storage types on AKS
Shell
1
star
78

azuredevops-pipeline-agent

Shell
1
star
79

vault-tfc-approle

Example of using AppRole Auth Method with Terraform Cloud
HCL
1
star
80

kthw-terraform-multicloud

Terraform scripts to deploy the necessary infrastructure to do Terrraform the Hard Way on multiple clouds.
HCL
1
star
81

Configuring-Security-Services-and-Policies-in-Microsoft-Azure

Repository for my Pluralsight course
PowerShell
1
star