This project contains Terraform templates to help you deploy Lattice on Google Cloud.
- A Google Cloud account
- A Google Compute Engine project
- A Google Compute Engine account file
- A Google Compute Engine Password-less SSH Key
Here are some step-by-step instructions for configuring a Lattice cluster via Terraform:
- Visit the Lattice GitHub Releases page
- Select the Lattice version you wish to deploy and download the Terraform example file for your target platform. The filename will be
lattice.google.tf
- Create an empty folder and place the
lattice.google.tf
file in that folder. - Update the
lattice.google.tf
by filling in the values for the variables. Details for the values of those variables are below.
The available variables that can be configured are:
gce_account_file
: Path to the JSON file used to describe your account credentials, downloaded from Google Cloud Consolegce_project
: The name of the project to apply any resources togce_ssh_user
: SSH usergce_ssh_private_key_file
: Path to the SSH private key filegce_region
: The region to operate under (defaultus-central1
)gce_zone
: The zone that the machines should be created in (defaultus-central1-a
)gce_ipv4_range
: The IPv4 address range that machines in the network are assigned to, represented as a CIDR block (default10.0.0.0/16
)gce_image
: The name of the image to base the launched instances (defaultubuntu-1404-trusty-v20141212
)gce_machine_type_brain
: The machine type to use for the Lattice Brain instance (defaultn1-standard-1
)gce_machine_type_cell
: The machine type to use for the Lattice Cells instances (defaultn1-standard-4
)num_cells
: The number of Lattice Cells to launch (default3
)lattice_username
: Lattice username (defaultuser
)lattice_password
: Lattice password (defaultpass
)
Refer to the Terraform Google Cloud provider documentation for more details about how to configure the proper credentials.
Here are some step-by-step instructions for deploying a Lattice cluster via Terraform:
- Run the following commands in the folder containing the
lattice.google.tf
file
terraform get -update
terraform apply
This will deploy the cluster.
Upon success, terraform will print the Lattice target:
Outputs:
lattice_target = x.x.x.x.xip.io
lattice_username = xxxxxxxx
lattice_password = xxxxxxxx
which you can use with the Lattice CLI to ltc target x.x.x.x.xip.io
.
Terraform will generate a terraform.tfstate
file. This file describes the cluster that was built - keep it around in order to modify/tear down the cluster.
Refer to the Lattice CLI documentation.
Destroy the cluster:
terraform destroy
The provided examples (i.e., lattice.google.tf
) are pinned to a specific Bump commit or release tag in order to maintain compatibility between the Lattice build (lattice.tgz
) and the Terraform definitions. Currently, Terraform does not automatically update to newer revisions of Lattice.
If you want to update to the latest version of Lattice:
- Update the
ref
in thesource
directive of yourlattice.google.tf
tomaster
. - Run
terraform get -update
to update the modules under the.terraform/
folder.
If you want to update to a specific version of Lattice:
- Choose a version from either the Bump commits or Releases.
- Update the
ref
in thesource
directive of yourlattice.google.tf
to that version. - Run
terraform get -update
to update the modules under the.terraform/
folder.
See LICENSE for details. Copyright (c) 2015 Pivotal Software, Inc.