This repo contains sets of simple Terraform IaC for Google Cloud
Service:
- Terraform - Cloud Agonistic Infrastructure as Code (IaC) service
Cloud Provider:
- GCP - Cloud Infrastructure Provider on Google Platform
The infrastructure for the project is as defined below.
├── README.md <-------------- This guide to the project.
├── terraform_vm_vpc<------------ Contains terraform code for creating a GCP Virtual Machine and Virtual Private Cloud
└──imgs <------------------ images for README.md
- A GCP Account and Project
- GCP APIs Enabled:
- GCP Service Account:
- Install GCP SDK
brew cask install google-cloud-sdk
- Create a GCP bucket
- This bucket will hold the terraform state file
- All buckets must have a unique name
- Create a folder within the bucket named
terraform1
- Add your json service account key to the root directory
- Change directory into a folder with terraform code
- Change the main.tf file to your unique configurations (comments are in the file for guidance)
- Run the following commands:
terraform init
: initalizes your working directoryterraform plan
: shows the execution plan for your infrastructure. Lets you see which resources are being createdterraform apply
: apply changes to the infrastructure through changes made in the main.tf file