Skip to content

Terraform manifests to get nurax, nurax-pg, and all dependencies running in AWS

Notifications You must be signed in to change notification settings

samvera-labs/nurax-terraform

Repository files navigation

Terraform Infrastructure for Nurax

Overview

This project contains the Terraform scripts required to build and maintain the AWS infrastructure running the Nurax demo/test instance for the Hyrax.

The resources created include:

  • A dedicated Virtual Private Cloud, split into six subnets across three availability zones
  • An RDS Postgresql database instance, with individual databases for the dev, stable, and pg Nurax instances as well as the shared Fedora instance
  • An ElastiCache Redis cluster, for Rails caching and ActiveJob message queueing
  • An Elastic Container Service cluster, which hosts the serverless containers running the shared Fedora and Solr instances as well as the individual Nurax containers
  • A Route53 zone, which provides DNS services for the Nurax applications and their dependencies
  • The various IAM roles, security groups, load balancers, task/service definitions, and SSL certificates required to allow Nurax to run on the above resources

Use

Prerequisites

  • A working copy of this repository
  • The AWS CLI
  • An AWS Profile with administrative access to the account you will be deploying under (the remainder of this document will assume that profile is called nurax)
  • Terraform 1.3 or higher

Preparation

  1. Set up your AWS environment:
    export AWS_PROFILE=nurax AWS_REGION=us-east-2
    
  2. Create a file called terraform.tfvars in the project's root directory. The only required variable is the hosted_zone_name, but see variables.tf for a list of other variables that can be overridden. For the basic (existing) installation, the file should look like this:
    hosted_zone_name = samvera.org
    
  3. Install Terraform providers and modules:
    terraform init
    
    The first time you run this, you will be asked for the name of an S3 bucket where the terraform state will be persisted. The existing infrastructure uses a bucket named nurax-terraform, which is what you should use unless you are setting up a completely separate instance.
  4. Have Terraform check the existing infrastructure against the spec:
    terraform plan -out terraform.plan
    
  5. Read over the output to see what changes (if any) Terraform thinks it needs to make to bring things up to spec. If they look correct, have Terraform apply the plan it just saved:
    terraform apply terraform.plan
    

Console Access

  1. Connect to the nurax-console EC2 instance via SSH.
  2. Find the task id in the AWS ECS dashboard for the desired nurax instance.
  3. Choose webapp or worker container
  4. Run aws ecs execute-command --cluster nurax --task {task id} --container {webapp|worker} --interactive --command "/bin/bash"

About

Terraform manifests to get nurax, nurax-pg, and all dependencies running in AWS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published