Terraform deployment for production Spoke
  • HCL 93%
  • Shell 7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2019-07-02 12:17:40 -04:00
bin Use whitespace-safe [[ command. 2018-08-31 11:42:23 -04:00
dummy-src Upgrade terraform to v0.12. Add Elastic Beanstalk module. 2019-06-10 14:47:49 -04:00
modules fix: tighten up application load balancer settings. 2019-07-02 12:17:40 -04:00
.gitignore Upgrade terraform to v0.12. Add Elastic Beanstalk module. 2019-06-10 14:47:49 -04:00
LICENSE Add license. Update input/output descriptions." 2018-09-22 08:02:49 -04:00
main.tf fix: tighten up application load balancer settings. 2019-07-02 12:17:40 -04:00
outputs.tf feat: expose certificate ARN as output. 2019-07-02 11:24:43 -04:00
README.md Updates for Aurora PostgreSQL Serverless. 2019-06-07 17:56:56 -04:00
variables.tf fix: tighten up application load balancer settings. 2019-07-02 12:17:40 -04:00

Spoke Terraform Module

This module creates production stack infrastrucuture for Rewired hosted Spoke. It does not deploy releases; that must be done manually using a script included in /bin.

Prerequisites

The wildcard domain must be configured in AWS Certificates prior to deployment. This will be of the form *.spoke.[client].politicsrewired.dev.

Usage

In a dedicated production management folder, create a main.tf Terraform file referencing this module:

provider "aws" {
  access_key                    = "SomeAccessKey"
  secret_key                    = "ExtraSuperSecret"
  region                        = "us-east-2"
}

module "spoke" {
  source  = "/path/to/spoke-terraform"
}

The complete list of configuration options is available in variables.tf.

Initialize and Run Terraform

$ terraform init
$ terraform apply

Deploying Spoke Code

Prerequisites

You will need Claudia.js to package Spoke:

$ npm install -g claudia

Run the build script

This will compile and package the Spoke server- and client-side applications and provide you with the appropriate terraform apply command to run.

$ ./bin/build --path ../Spoke \
      --domain spoke.domain.com \
      --bucket spoke.domain.com \
      --region us-east-1

Note: You must supply the same values for the domain, bucket name, and AWS region that you provided in the Terraform configuration file above.

For complete usage of the build script, see:

$ ./bin/build --help