Git Product home page Git Product logo

terraforming-gcp's Introduction

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.

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!

This list will be updated when more infrastructures come along.

Prerequisites

Your system needs the gcloud cli, as well as terraform:

brew update
brew install Caskroom/cask/google-cloud-sdk
brew install terraform

Notes

You will need a key file for your service account to allow terraform to deploy resources. If you don't have one, you can create a service account and a key for it:

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:

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.

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_url = "https://storage.googleapis.com/ops-manager-us/pcf-gcp-1.12.0.tar.gz"

buckets_location = "US"

ssl_cert = <<SSL_CERT
-----BEGIN CERTIFICATE-----
some cert
-----END CERTIFICATE-----
SSL_CERT

ssl_private_key = <<SSL_KEY
-----BEGIN RSA PRIVATE KEY-----
some cert private key
-----END RSA PRIVATE KEY-----
SSL_KEY

service_account_key = <<SERVICE_ACCOUNT_KEY
{
  "type": "service_account",
  "project_id": "your-gcp-project",
  "private_key_id": "another-gcp-private-key",
  "private_key": "-----BEGIN PRIVATE KEY-----another gcp private key-----END PRIVATE KEY-----\n",
  "client_email": "[email protected]",
  "client_id": "11111111111111",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/"
}
SERVICE_ACCOUNT_KEY

Var Details

  • env_name: (required) An arbitrary unique name for namespacing resources. Max 23 characters.
  • project: (required) ID for your GCP project.
  • region: (required) Region in which to create resources (e.g. us-central1)
  • zones: (required) Zones in which to create resources. Must be within the given region. Currently you must specify exactly 3 Zones for this terraform configuration to work. (e.g. [us-central1-a, us-central1-b, us-central1-c])
  • opsman_image_url (required) Source URL of the Ops Manager image you want to boot.
  • service_account_key: (required) Contents of your service account key file generated using the gcloud iam service-accounts keys create command.
  • dns_suffix: (required) Domain to add environment subdomain to (e.g. foo.example.com)
  • buckets_location: (optional) Loction in which to create buckets. Defaults to US.
  • ssl_cert: (optional) SSL certificate for HTTP load balancer configuration. Required unless ssl_ca_cert is specified.
  • ssl_private_key: (optional) Private key for above SSL certificate. Required unless ssl_ca_cert is specified.
  • ssl_ca_cert: (optional) SSL CA certificate used to generate self-signed HTTP load balancer certificate. Required unless ssl_cert is specified.
  • ssl_ca_private_key: (optional) Private key for above SSL CA certificate. Required unless ssl_cert is specified.
  • opsman_storage_bucket_count: (optional) Google Storage Bucket for BOSH's Blobstore.
  • create_iam_service_account_members: (optional) Create IAM Service Account project roles. Default to true.

DNS Records

  • pcf.$env_name.$dns_suffix: Points at the Ops Manager VM's public IP address.
  • *.sys.$env_name.$dns_suffix: Points at the HTTP/S load balancer in front of the Router.
  • doppler.sys.$env_name.$dns_suffix: Points at the TCP load balancer in front of the Router. This address is used to send websocket traffic to the Doppler server.
  • loggregator.sys.$env_name.$dns_suffix: Points at the TCP load balancer in front of the Router. This address is used to send websocket traffic to the Loggregator Trafficcontroller.
  • *.apps.$env_name.$dns_suffix: Points at the HTTP/S load balancer in front of the Router.
  • *.ws.$env_name.$dns_suffix: Points at the TCP load balancer in front of the Router. This address can be used for application websocket traffic.
  • ssh.sys.$env_name.$dns_suffix: Points at the TCP load balancer in front of the Diego brain.
  • tcp.$env_name.$dns_suffix: Points at the TCP load balancer in front of the TCP router.

Isolation Segments (optional)

  • isolation_segment: (optional) When set to "true" creates HTTP load-balancer across 3 zones for isolation segments.
  • iso_seg_ssl_cert: (optional) SSL certificate for Iso Seg HTTP load balancer configuration. Required unless iso_seg_ssl_ca_cert is specified.
  • iso_seg_ssl_private_key: (optional) Private key for above SSL certificate. Required unless iso_seg_ssl_ca_cert is specified.
  • iso_seg_ssl_ca_cert: (optional) SSL CA certificate used to generate self-signed Iso Seg HTTP load balancer certificate. Required unless iso_seg_ssl_cert is specified.
  • iso_seg_ssl_ca_private_key: (optional) Private key for above SSL CA certificate. Required unless iso_seg_ssl_cert is specified.

Ops Manager

  • opsman_sql_db_host: (optional) The host the user can connect from. Can be an IP address. Changing this forces a new resource to be created.

PAS

  • pas_sql_db_host: (optional) The host the user can connect from. Can be an IP address. Changing this forces a new resource to be created.

PAS Cloud Controller's Google Cloud Storage Buckets (optional)

  • create_gcs_buckets: (optional) When set to "false", buckets will not be created for PAS Cloud Controller. Defaults to "true".

PKS (optional)

  • pks: (optional) When set to "true" creates a tcp load-balancer for PKS api, dedicated subnets and allows access on Port 8443 to masters external IP address for kubectl access

Running

Note: please make sure you have created the terraform.tfvars file above as mentioned.

Standing up environment

terraform init
terraform plan -out=plan
terraform apply plan

Tearing down environment

terraform destroy

terraforming-gcp's People

Contributors

genevieve avatar davewalter avatar wendorf avatar rainmaker avatar ryanmoran avatar ameowlia avatar desmondrawls avatar kkallday avatar vchrisb avatar cwlbraa avatar zachgersh avatar matt-royal avatar ljfranklin avatar drich10 avatar mcwumbly avatar amohemed avatar adi-mishra avatar ekcasey avatar madamkiwi avatar markstokan avatar rowanjacobs avatar

Watchers

James Cloos avatar Ilya Kislenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.