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
- 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
- Set up your AWS environment:
export AWS_PROFILE=nurax AWS_REGION=us-east-2
- Create a file called
terraform.tfvars
in the project's root directory. The only required variable is thehosted_zone_name
, but seevariables.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
- Install Terraform providers and modules:
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
terraform init
nurax-terraform
, which is what you should use unless you are setting up a completely separate instance. - Have Terraform check the existing infrastructure against the spec:
terraform plan -out terraform.plan
- 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
- Connect to the nurax-console EC2 instance via SSH.
- Find the task id in the AWS ECS dashboard for the desired nurax instance.
- Choose webapp or worker container
- Run
aws ecs execute-command --cluster nurax --task {task id} --container {webapp|worker} --interactive --command "/bin/bash"