This repository contains Terraform templates which define resources to host an AR.IO gateway on AWS.
The domains are managed with Vercel, the rest is hosted on AWS.
Note: Current version used for first deploy is 15. This version is defined in resources/userdata.sh and should be updated when new releases are available.
There are two kinds of environment variables:
- Variables used by Terraform at deployment time.
- Variables used by the AR.IO gateway instances at runtime.
Define Terraform inputs and provider API keys via environment variables.
This allows to keep the secrets out of the Terraform configuration files and use GitHub Actions to deploy the infrastructure.
Copy resources/template.env.terraform to resources/.env.terraform and fill
in the values to configure the Terraform deployment.
Terraform will encrypt and upload resources/.env.gateway into the SSM
Parameter Store, allowing the gateway instances to fetch them at boot time.
Copy the resources/template.env.gateway to resources/.env.gateway and fill
in the values.
These commands will use the environment variables from
resources/.env.terraform.
Plan the deployment and save the plan into a file.
scripts/plan
Deploy the infrastructure from the plan file and save the outputs into
resources/outputs.
scripts/apply
Delete all AWS resources.
scripts/destroy
You don't need to redeploy the infrastructure to update the gateway. The follwing commands will just stop each instance and update it.
These commands will create an archive with the a new revision of the gateway, upload it to S3 and update the instances via CodeDeploy.
To create a new update from a template if the version you need doesn't exist yet.
scripts/prepare-revision <VERSION>
After running this command follow these steps:
- Copy the new
docker-compose.yamlfrom thear-io/ar-io-nodeGitHub repo into your newly created revision source folder. (e.g.,revisions/<VERSION>/source) - delete
build:from each service - add
pull_policy: alwaysto each service - update the
AR_IO_NODE_RELEASEenvironment variable to reflect the revision.
To archive, upload, and deploy the update:
scripts/deploy-revision <VERSION>
SSM Session Manager is the only way to SSH into the instances.