Skip to content

Getting Started Guide for Terraform and Google Cloud Platform using a Google Cloud Shell tutorial

License

Notifications You must be signed in to change notification settings

hashicorp/terraform-getting-started-gcp-cloud-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 

Terraform Getting Started Guide on GCP with Cloud Shell

A Getting Started Tutorial for Terraform and Google Cloud Platform (GCP), using Google's interactive Cloud Shell.

This tutorial will help you learn Terraform, an open source Infrastructure as Code tool.

This tutorial assumes you know basic GCP concepts and terminology.

Launch the tutorial

To follow this tutorial, you will need a Google Cloud Platform account. If you do not have a GCP account, create one now. This tutorial uses services included in the GCP free tier.

Complete this tutorial in Google's Cloud Shell.

When prompted to trust the tutorial image, answer "Yes".

Use a custom image

This tutorial uses a Docker image. The version of Terraform included in that image (v1.0.1) may not be the latest version. To build and use a Docker image with the latest version see the instructions below.

Build the Docker image

  1. Set up Docker and the gcloud command line utility as described in the "Before you begin" section of the GCP Container Registry Quickstart.
  2. Build the image:
    docker build . -t terraform-gcp-gsg:v$(date "+%Y-%m-%d")
  3. Optionally, inspect/test image locally:
    docker run -it --entrypoint /bin/sh terraform-gcp-gsg:v$(date "+%Y-%m-%d")

Deploy Docker Image the GCP Image Registry

  1. Make sure docker is configured to authenticate with gcloud:
    gcloud auth configure-docker
  2. Tag the image, replacing [PROJECT-ID] with your Google Cloud's project ID:
    docker tag terraform-gcp-gsg:v$(date "+%Y-%m-%d") gcr.io/[PROJECT-ID]/terraform-gcp-gsg:v$(date "+%Y-%m-%d")

Use the Docker image with Cloud Shell

  1. Update the URL above to use the URL to your new docker image.
  2. You'll be prompted to trust this image. Answer "Yes".

About

Getting Started Guide for Terraform and Google Cloud Platform using a Google Cloud Shell tutorial

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published