package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# README

roachprod AWS Configuration

Overview

EC2 on AWS requires a bunch of per-region and per-AZ resources in order to operate properly. In particular, we need to set up an AMI and security group per region and a subnet per AZ. We also need to set up peering between each pair of available AZs.

This set of resources is provided to roachprod via a configuration struct serialized as JSON (see config.go). A bespoke config can be provided to roachprod by passing a file path to --aws-config. The default config is compiled into the roachprod binary using go-bindata (see the go:generate comments in config.go).

In order to manage and create these resources, we use terraform. However, even that is sort of painful given we need to construct all the pairings there too. A small utility, terraformgen, generates terraform/main.tf based on its hard-coded listing of regions and other AWS account properties. The configuration of per-region and peering setups live in terraform.

Regeneration

Regenerating the resources and producing the config.json file requires running terraform. Unfortunately, terraform changed its type system between versions 0.11 and 0.12. The tf files used by this tool are in the 0.11 format. In order to regenerate, you need to use 0.11.

In order to sync the resources with AWS, run terraform from the terraform directory.

terraform init
terraform apply
terraform output --json > ../config.json

# Packages

Command terraformgen generate the terraform file used to configure AWS for multiregion support.

# Functions

DefaultProviderOpts returns a new aws.ProviderOpts with default values set.
Init initializes the AWS provider and registers it into vm.Providers.

# Constants

ProviderName is aws.

# Variables

DefaultZones is the list of availability zones used by default for cluster creation.

# Structs

CancelSpotInstanceRequestsOutput represents the output structure of the cancel-spot-instance-requests command.
DescribeInstancesOutput represents the output of the aws ec2 describe-instances command.
DescribeSpotInstanceRequestsOutput represents the output of the aws ec2 describe-spot-instance-requests command.
Provider implements the vm.Provider interface for AWS.
ProviderOpts provides user-configurable, aws-specific create options.
RunInstancesOutput represents the output of the aws ec2 run-instances command.

# Type aliases