1.6 KiB
1.6 KiB
Terraform
Infra is managed by Terraform (WIP, not everything is migrated yet).
Managed with Terraform:
- Vercel
- Digital Ocean (database)
- Heroku
TODO:
- Algolia
- Twitter bot
- DNS?
Recipes
Set up a new dev repo for managing prod
- Install Terraform CLI
cd tf
terraform init
- Get a current version of prod tfvars configuration
- Source is in
metaforecast-notes-and-secrets
secret repo,tf/prod.auto.tfvars
for now (will move to Terraform Cloud later) - Store it in
tf/prod.auto.tfvars
(or somewhere else, there are other ways)
- Source is in
- Get a current version of terraform state
- Source is in
metaforecast-notes-and-secrets
secret repo for now (will move to Terraform Cloud or pg backend later) - Store it in
tf/terraform.tfstate
- Source is in
Now everything is set up.
Check with terraform plan
; it should output "No changes. Your infrastructure matches the configuration."
.
Edit environment variables in prod
- Update terraform state and vars from
metaforecast-notes-and-secrets
- Modify
tf/prod.auto.tfvars
as needed - Run
terraform apply
- Check if proposed actions list is appropriate
- Enter
yes
- Terraform will push the new configuration to Heroku and Vercel.
- Push terraform state and vars back to
metaforecast-notes-and-secrets
(After we move to Terraform Cloud (1) and (4) won't be needed.)