# terraforming-gcp **Repository Path**: mirrors_vmware-archive/terraforming-gcp ## Basic Information - **Project Name**: terraforming-gcp - **Description**: use terraform, deploy yourself a pcf - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-25 - **Last Updated**: 2025-09-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DEPRECATION This repo is going to be archived. The terraform templates that _should_ be used for deploying an Ops Manager, PAS and/or PKS, can be found at https://github.com/pivotal/paving No PRs or Issues will be responded to here. # Terraforming GCP ## How Does One Use This? Please note that the master branch is generally *unstable*. If you are looking for something "tested", please consume one of our [releases](https://github.com/pivotal-cf/terraforming-gcp/releases). ## What Does This Do? You will get a booted ops-manager VM plus some networking, just the bare bones basically. ## Looking to setup a different IAAS We have have other terraform templates to help you! - [aws](https://github.com/pivotal-cf/terraforming-aws) - [azure](https://github.com/pivotal-cf/terraforming-azure) This list will be updated when more infrastructures come along. ## Prerequisites Your system needs the `gcloud` cli, as well as `terraform`: ```bash brew update brew install Caskroom/cask/google-cloud-sdk brew install terraform ``` ## Are you using Platform Automation? Be sure to skip the creation of the Ops Manager VM. Do not include the vars listed [here](/README.md#ops-manager-optional). If you create your Ops Manager using terraform, you will not be able to manage it with [Platform Automation](https://docs.pivotal.io/platform-automation). Deployment of the infrastructure is still required. ## Deploying Infrastructure Depending if you're deploying PAS, PKS or Control Plane you need to perform the following steps: 1. `cd` into the proper directory: - [terraforming-pas/](terraforming-pas/) - [terraforming-pks/](terraforming-pks/) - [terraforming-control-plane/](terraforming-control-plane/) 1. Create [`terraform.tfvars`](/README.md#var-file) file 1. Run terraform apply: ```bash terraform init terraform plan -out=plan terraform apply plan ``` ## Notes You will need a key file for your [service account](https://cloud.google.com/iam/docs/service-accounts) to allow terraform to deploy resources. If you don't have one, you can create a service account and a key for it: ```bash gcloud iam service-accounts create ACCOUNT_NAME --display-name "Some Account Name" gcloud iam service-accounts keys create "terraform.key.json" --iam-account "ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com" gcloud projects add-iam-policy-binding PROJECT_ID --member 'serviceAccount:ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com' --role 'roles/owner' ``` You will need to enable the following Google Cloud APIs: - [Identity and Access Management](https://console.developers.google.com/apis/api/iam.googleapis.com) - [Cloud Resource Manager](https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/) - [Cloud DNS](https://console.developers.google.com/apis/api/dns/overview) - [Cloud SQL API](https://console.developers.google.com/apis/api/sqladmin/overview) - [Compute Engine API](https://console.developers.google.com/apis/library/compute.googleapis.com) ### Var File Copy the stub content below into a file called `terraform.tfvars` and put it in the root of this project. These vars will be used when you run `terraform apply`. You should fill in the stub values with the correct content. ```hcl env_name = "some-environment-name" project = "your-gcp-project" region = "us-central1" zones = ["us-central1-a", "us-central1-b", "us-central1-c"] dns_suffix = "gcp.some-project.cf-app.com" opsman_image = "ops-manager-2-10-build-48" buckets_location = "US" ssl_cert = <