https://github.com/developer-dao/ario-gateway-aws
https://github.com/developer-dao/ario-gateway-aws
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developer-dao/ario-gateway-aws
- Owner: Developer-DAO
- Created: 2024-04-10T08:19:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T10:15:20.000Z (over 1 year ago)
- Last Synced: 2025-01-13T15:17:23.439Z (about 1 year ago)
- Language: HCL
- Size: 46.9 KB
- Stars: 26
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AR.IO Gateway Infrastructure
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](resources/userdata.sh#L144) and should be updated when
> new releases are available.
## Environment Variables
There are two kinds of environment variables:
1. Variables used by Terraform at deployment time.
2. Variables used by the AR.IO gateway instances at runtime.
### Terraform Deploy
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.
### AR.IO Gateway Configuration
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.
## Infrastructure Deployment
These commands will use the environment variables from
`resources/.env.terraform`.
### Plan
Plan the deployment and save the plan into a file.
scripts/plan
### Apply
Deploy the infrastructure from the plan file and save the outputs into
`resources/outputs`.
scripts/apply
### Destroy
Delete all AWS resources.
scripts/destroy
## Gateway Updates
You don't need to redeploy the infrastructure to update the gateway. The
follwing commands will just stop each instance and update it.
### Update Gateway
These commands will create an archive with the a new revision of the gateway,
upload it to S3 and update the instances via CodeDeploy.
#### Creating an Update
To create a new update from a template if the version you need doesn't exist yet.
scripts/prepare-revision
After running this command follow these steps:
- Copy the new `docker-compose.yaml` from the `ar-io/ar-io-node` GitHub repo
into your newly created revision source folder. (e.g.,
`revisions//source`)
- delete `build:` from each service
- add `pull_policy: always` to each service
- update the `AR_IO_NODE_RELEASE` environment variable to reflect the revision.
#### Deploying an Update
To archive, upload, and deploy the update:
scripts/deploy-revision
## SSH Access
SSM Session Manager is the only way to SSH into the instances.