
Learn how to manage cloud infrastructure with infrastructure as code using Terraform in Google Cloud, including projects, IAM policies, and reusable templates for production-ready setups.
Learn how to use Terraform to codify hybrid and multi-cloud infrastructure for infra and app modernization, enabling a single configuration and pipeline across Google Cloud and other platforms.
Ensure you meet prerequisites: basic GCP knowledge and Linux command skills, as this course teaches infrastructure as code with Terraform and covers load balancing, managed instance groups, and secret manager.
Prepare the environment for the terraform in gcp series by configuring a google identity and a gcp project with billing, and using vscode with the terraform extension and cloud shell.
Explore Terraform, an open source infrastructure as code tool, to declaratively define and provision cloud resources across Google Cloud Platform, AWS, and Azure, with modules and state management.
Install and configure terraform on Linux and Windows. Use Google Cloud Shell and create a project and service account, plus set up a cloud storage bucket for state.
Learn to run terraform from Google Cloud Shell, a ready-made GCP VM with an editor and gcloud commands; you can also install the Google Cloud SDK locally.
Configure authentication and authorization for Terraform in GCP by creating a dedicated service account, downloading its JSON key, and granting IAM permissions at the project and organization levels.
Create a dedicated Google Cloud Storage bucket using the project ID for a globally unique name to store Terraform state, configure regional standard storage, and enforce public access prevention.
Configure the service account with Terraform IAM roles in GCP, granting organization and project permissions such as organization policy administrator, folder admin, billing administrator, and project creator, following least privilege.
Configure the billing account in GCP and link projects for Terraform to attach them. Choose trial credits, set budget alerts, and grant the billing account administrator role.
Set up Terraform for GCP by creating provider.tf and backend.tf and configuring credentials json. Store state in a GCS bucket and run Terraform init to verify the configuration.
Configure Terraform to use the Google provider and set up a Google Cloud Storage backend for remote state, including bucket, credentials, and state prefix.
Discover the basics of Terraform, including file structure, provider and backend setup, and the four core commands init, plan, apply, and destroy, to safely provision and manage GCP resources.
Learn to name and reference Terraform resources in GCP, using the resource type dot resource name syntax, follow GCP naming rules, and leverage outputs and destroy for management.
Explore how Terraform plan, apply, and destroy show an execution plan of resources to create, update in place, or delete, using plus, tilde, and minus symbols, with the legend.
Leverage variables and modules to make terraform configurations portable and reusable across environments by defining string, number, boolean, and complex variables in a variables.tf file and referencing them with var.name.
Explore structured and complex variables in terraform, declaring objects and lists, using a vm configuration object and a tags list, and introducing the terraform.tf vars file for practical configuration.
Learn how to manage Terraform variables in GCP with terraform.tfvars, override variables.tf, prompt for missing values, and plan and apply while viewing outputs like VM name and IP.
Learn to use Terraform outputs to display VM details by creating an outputs file and selecting values such as VM name and IPs from a Google Compute Engine instance.
Replace the service account key file with short-lived credentials to authenticate Terraform in GCP, by impersonating the core service account and using a temporary access token. Configure the Google provider to use the access token via the Google OAuth Access Token environment variable and grant the service account token creator role for secure, production-ready access.
Explore essential Terraform references for GCP, including Google provider docs and Resource Manager resources like Google folder and Google project, and learn practices for landing zones with Cloud Foundation fabric.
Split the Terraform setup into core and environment configurations to protect the core project from destruction. Migrate the state to a dedicated GCS backend and use core and environment prefixes.
Use Terraform to create a three-folder GCP structure (my GCP env, network, infrastructure) and provision two projects (infra and network) under those folders with plan and apply.
Learn to enable and manage Google Cloud services across three projects with Terraform, using google_project_service blocks, count for multiple services (Compute Engine, Cloud SQL), and modules to streamline setup.
Learn to configure GCP budgets and alerts with Terraform by defining a budget resource and notification channels, enabling the billing budgets API, and applying project-wide thresholds.
Deploy a custom VPC in GCP with Terraform, create a regional subnet, and enable shared VPC by linking a host project to the infrastructure service project.
Manually grant IAM permissions for the shared VPC by assigning compute network user roles to the application project and the service agent, then migrate to Terraform for automated management.
Deploy two Google Compute Engine VMs in a shared VPC with Terraform, including app and database VMs, startup scripts, boot disks, labels, and outputs for internal and external IP addresses.
Transition from a VM to scalable, resilient architecture using managed instance groups and instance templates, with startup scripts stored in Google Cloud Storage via Terraform for automatic healing and scaling.
Implement automated, scalable infrastructure in GCP by building a managed instance group with a Compute Engine instance template, health check, and named ports, orchestrated through Terraform.
Create a Google compute instance template for a business app VM using the same variables as app VM, and reference a startup script URL in metadata from a GCS bucket.
Create a google compute health check in GCP using Terraform for an instance group manager, configuring timeout, check interval, healthy and unhealthy thresholds, and a tcp port.
Configure a region-based managed instance group with an instance template, set a target size of three VMs, and attach a health check with autohealing and a 300 second delay.
Configure a regional autoscaler for a managed instance group in gcp using terraform, linking the autoscaler to the instance group and template, define min and max replicas, and scaling policies.
Explore how the global forwarding rule, target https proxy, url map, and back end service work with health checks and a global ip to publish apps on gcp.
Build a global https load balancer in GCP using Terraform, configure health checks, ssl certificates, a url map, a backend service, and an instance group, then plan and apply.
Configure and manage GCP VPC firewall rules with Terraform, enabling health checks, internal and IP traffic, identity-aware proxy traffic, and consistent named ports for load balancer integration.
Configure a nat gateway in gcp with terraform by provisioning a static public ip, a cloud router, and a nat gateway, then remove public ips from vms and test plan/apply.
Apply Terraform lifecycle blocks to manage resource creation and ignore changes, and leverage the random provider to optimize the instance template without triggering unnecessary updates.
Use the Terraform random provider to generate a unique instance template name with a random suffix, and configure a proactive update policy (max surge, zero max unavailable) for safe updates.
Explore how Terraform applies configurations in GCP, revealing race conditions in enabling services and resource creation, and learn practical workarounds like delays, depends_on sequencing, and lifecycle prevent_destroy.
Explore advanced Terraform apply behavior in GCP, including safe state management, caveats of manual state removal, and using dependencies to ensure correct creation order of projects, buckets, and networks.
Build a privately accessible cloud sql instance in gcp using terraform, following six configuration blocks: global internal ip range, private vpc connection, random id, instance, database and user, and outputs.
Learn to provision Google Cloud SQL with Terraform in GCP, configuring internal IPs via VPC peering or Private Service Connect, and manage instance, databases, and users.
Configure private vpc connections in gcp with terraform by creating a global internal address, a service networking connection, and peering ranges, ensuring proper project references and deployment order.
Learn to provision Google Cloud SQL instances in GCP with Terraform, configuring private connectivity via VPC peering, backup settings, and IP options, with dependencies and API enablement.
Learn how to manage iam in gcp with terraform, comparing iam policy, iam binding, and iam member approaches, their impact on permissions, risks of lockout, and how to import resources.
Learn how to manage gcp iam policy with terraform, building a data block with bindings, importing existing configuration, and safely applying changes in a test project.
Learn to recover lost IAM roles using Cloud Asset Inventory and Terraform import; view change history to restore service accounts and import the policy into Terraform state.
Manage GCP iam roles with Terraform using the iam_binding resource, binding a single role per block to avoid affecting other roles. Import state, plan, and apply updates for project bindings.
Learn how the iam_member resource manages GCP permissions with Terraform, a non-authoritative approach that avoids drift in a core project; compare it with IAM binding and policy.
Learn to secure access to GCP resources and VMs with Identity-Aware Proxy through Terraform, enabling IAP from the cloud console and configuring SSH and TCP permissions.
Learn to enable IAP access to GCP VMs with Terraform, for a single instance and a dynamic instance group, using IAM roles, OS login, and project- vs instance-level permissions.
Enable the cloud identity-aware proxy for compute engine vms in GCP using Terraform by configuring the IAP service, VM tags, and OS login, then apply IAM permissions.
Configure gcp iam permissions for iap with Terraform, using locals for project id, and apply ip secured tunnel user, os login, and service account bindings to bastion host and vms.
Create a custom GCP IAM role with Terraform to grant only Compute Engine set metadata permission, assign to select users, and enable IAM API for IAP and OS Login access.
Create a GCP service account with terraform, generate and securely manage its keys, and attach it to a VM using an updated instance template and IAM roles.
Create a Google service account with Terraform, export its key to a json file in an outputs folder, and assign roles instance admin, logs writer, and storage object creator.
Enable Google Secret Manager in your GCP project, create a secret with Terraform, manage secret versions, and read them with a data source to configure Cloud SQL passwords.
Enable the secret manager service and create a secret with terraform, using automatic or user-managed replication, optionally customer-managed keys, and isolate secrets in a dedicated project.
Create and manage secret versions in Google Cloud Secret Manager with Terraform, and securely retrieve the latest version or a specific version using a data block.
Explore configuring Google Cloud Armor in Terraform, set up OWASP top ten rules with dynamic blocks, and implement a default allow rule to protect public HTTPS endpoints.
Learn to configure Google Cloud Armor policies in GCP with Terraform, defining a Cloud Armor policies map, using dynamic blocks to build rules, and linking to a backend service.
Unlock the Power of Infrastructure as Code on GCP with Terraform!
Transform Your Cloud Infrastructure
Welcome to the definitive course on leveraging Terraform within Google Cloud Platform (GCP) to automate, manage, and scale your cloud infrastructure. Whether you're a DevOps professional, a cloud engineer, or someone looking to harness the power of Infrastructure as Code (IaC) on GCP, then this course is the place for you!
Why Terraform with GCP?
Terraform, an open-source tool created by HashiCorp, enables you to define and provision a cloud infrastructure using a high-level simple to understand declarative configuration language. When combined with the power and flexibility of Google Cloud Platform (GCP), Terraform becomes a great tool and resource to manage your complex GCP environments and deployments..
How to use Terraform with GCP?
There are many ways you can use Terraform with GCP in your operations...
You can use it to deploy new landing zones in GCP very fast and easily
Use Terraform to provision and scale simple or complex environments fast and without effort
Automate your operations in GCP by integrating with CI/CD pipelines for automated resource deployments
Quickly deploy and reset sandbox and testing environments without effort and additional cost
What is in this course?
This course will walk you from the basics of Terraform in GCP. We will discover the steps to download and install Terraform, work with a starter simple deployment, and then expand that to a more scalable, more optimized deployment.
I will cover the most common services and operations in GCP with Terraform such as:
How to create projects in GCP using Terraform
How to provision VM instances in GCP using Terraform
How to provision and configure managed instance groups in GCP using Terraform
How to setup Global HTTPS load balancing in GCP using Terraform
How to work with Global IP Addresses and managed SSL certificates in GCP using Terraform
How to work with VPC and firewall in GCP using Terraform
How to work with IAM and service accounts in GCP using Terraform
How to provision and manage Cloud SQL instances in GCP using Terraform
How to create Cloud Armor policies in GCP using Terraform
Then once we cover the important topics of working with GCP using Terraform, I'll cover more interesting topics in Terraform such as building modules to extend and reuse our configuration anywhere!
I will close this course by showing you an quick overview and a demo on Google Cloud Foundation Fabric and Fabric FAST, which is a set of Terraform modules and blueprints to manage GCP and create scalable landing zones following Google's best practices!
What's more? Well, everything we build together in this course will be a reusable take away from this which you can reuse and customize for any use case and need that you have in your real life and work!
Can't wait to have you there! Share your feedback and what you learned with the others, and let's all go further and beyond what's in this course after you finish it!