Skip to content

A Terraform module to provision Girder4 infrastructure on Heroku + AWS.

License

Notifications You must be signed in to change notification settings

girder/terraform-heroku-girder4

Repository files navigation

terraform-heroku-girder4

A Terraform module to provision Girder4 infrastructure on Heroku + AWS.

This facilitates deployment of Django applications created from the Girder4 cookiecutter. It creates a Heroku app with addons for PostgreSQL, CloudAMQP, and Papertrail. It also creates AWS S3 storage, outgoing SMTP credentials, and an optional AWS EC2 worker.

See full usage documentation at Terraform Registry.

Note on AWS Email Sending

Every AWS account must explicitly apply to send real emails, once per Simple Email Service (SES) region.

Approvals seem to be granted liberally and to take about 24 hours.

Note on initial creation of Heroku apps

When first creating an instance of this module, provisioning of the Heroku app (specifically the heroku_formation resources) will likely fail with a "Couldn't find that process type" error message. To resolve this, the Heroku app code must be deployed at least once.

Typically, this can be done by connecting a GitHub repo to the Heroku app and then triggering a manual deploy. Finally, run terraform apply again, which should succeed.

Afterwards, it's advisable to also set up automatic deploys.

Note on EC2 Worker AMIs

Newly launched EC2 worker instances will use the latest AMI at the time of launch, but existing instances will not be replaced when a newer AMI is available. Thus, incrementally scaling up the ec2_worker_instance_quantity variable may result in multiple instances with slightly different AMIs.

Likewise, setting or changing the optional variable ec2_worker_launch_ami_id will only affect newly launched instances, but will also not trigger the replacement of any existing instances with a different AMI.

Use the -replace option with the module.<girder4>.module.ec2_worker[0].aws_instance.ec2_worker[*] target (where <girder4> is the local name of this module) to force the replacement of all existing instances.