This project contains Terraform templates to help you deploy Lattice on Amazon Web Services.
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.aws.tf
- Create an empty folder and place the
lattice.aws.tf
file in that folder. - Update the
lattice.aws.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:
aws_access_key
: AWS access keyaws_secret_key
: AWS secret keyaws_key_name
: The SSH key name to use for the instancesaws_ssh_private_key_file
: Path to the SSH private key fileaws_ssh_user
: SSH user (defaultubuntu
)aws_region
: AWS region (defaultus-east-1
)aws_vpc_cidr_block
: The IPv4 address range that machines in the network are assigned to, represented as a CIDR block (default10.0.0.0/16
)aws_subnet_cidr_block
: The IPv4 address range that machines in the network are assigned to, represented as a CIDR block (default10.0.1.0/24
)aws_image
: The name of the image to base the launched instances (defaultubuntu trusty 64bit hvm ami
)aws_instance_type_brain
: The machine type to use for the Lattice Brain instance (defaultm3.medium
)aws_instance_type_cell
: The machine type to use for the Lattice Cells instances (defaultm3.medium
)num_cells
: The number of Lattice Cells to launch (default3
)lattice_username
: Lattice username (defaultuser
)lattice_password
: Lattice password (defaultpass
)
Refer to the Terraform AWS 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.aws.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.aws.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.aws.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.aws.tf
to that version. - Run
terraform get -update
to update the modules under the.terraform/
folder.
The AWS Terraform configs now support Elastic IPs. This means the cluster can be stopped when it's not in-use (e.g., overnight to save on usage fees), and the Lattice cluster will retain the same target address when the instances are restarted. In order to do this, use the AWS EC2 Console, browse to Instances, and go to Instance State > Stop (or Start when reactivating) on the Lattice instances.
Please Note: There are hourly charges on having an Elastic IP provisioned but not associated to a running instance. More details can be found on AWS Pricing.
See LICENSE for details. Copyright (c) 2015 Pivotal Software, Inc.