Infrastructure as Code with Terraform
Introduction
This hack is intended as an introduction to provisioning GCP resources using Terraform. We’ll start with the basics of Infrastructure as Code (IaC) and help you automate the process of infrastructure provisioning.
Learning Objectives
In this hack you will be exploring the following tasks
- Setting up a version control system to hold your assets
- Setting up a Terraform backend
- Provisioning a few basic resources on GCP with Terraform
- Automating the process using Cloud Build
Challenges
- Challenge 1: Bootstrapping
- Terraform backend & version control
- Challenge 2: Your very first provisioning
- Let’s start with networking
- Challenge 3: Open the gates!
- Opening the Firewall ports
- Challenge 4: Hello HTTP server
- NGINX on a Linux VM
- Challenge 5: Automation
- Enable GitOps by running Terraform through Cloud Build
Prerequisites
- Your own GCP project with Owner IAM role
- Basic knowledge of GCP
- Knowledge of Git & Terraform
- Access to an environment to install & run CLI commands (e.g. Cloud Shell)
Contributors
- Murat Eken
- Mohammed Fawzi