This repository includes code and Terraform manifests for an AWS Lambda and AWS Step Functions to reliably start and stop resources within the NUL RDC staging environment as follows:
- Scale all ECS tasks in
meadow
,avr
, andarch
clusters down to 0 - Perform incremental backup of
avr
andarch
collections in Solr - Scale all ECS tasks in
fcrepo
andsolrcloud
clusters down to 0 - Stop
meadow-db
andstack-s-db
RDS instances
- Start
meadow-db
andstack-s-db
RDS instances if necessary- Wait for both instances to reach
available
state
- Wait for both instances to reach
- Scale
fcrepo
ECS service up to 1 - Scale up
solrcloud
ECS services- 3 Zookeeper nodes
- 4 Solr nodes
- Wait for the Solr cluster to report 4 stable, live nodes
- Restore
avr
andarch
Solr collections - Start
meadow
,avr
, andarch
ECS services
The Terraform manifests also create AWS EventBridge Rules to spin the stack up and down every weekday at 6am and 8pm Central, respectively.
To spin the staging environment up or down, execute the stack-s-spin-up-environment
or stack-s-spin-down-environment
Step Function, respectively, with the following payload:
{
"solr": {
"baseUrl": "http://solr.internal.rdc-staging.library.northwestern.edu:8983/solr/",
"collections": ["arch", "avr"]
},
"rds": {
"meadow": "meadow-db",
"stack": "stack-s-db"
}
}
There is also a staging-environment
utility script on the staging bastion host that can be used to spin the staging environment up or down on demand.