Follow these instructions to set up your environment so that you can contribute to the development of the project.
- Install Terraform. On macOS, the simplest way is probably
brew install terraform
. - Obtain secrets for your
.envrc
file (ask around in the team). - Move to the
infra/
dir and runterraform init
to set up Terraform. - You're done!
- To check, you can run
terraform plan
. It should refresh a bunch of resources, and eventually tell you that "No changes. Infrastructure is up-to-date." If you DO see proposed changes at this point, someone might be working on the infra right now. Ask around in your team!
IMPORTANT: These are probably not the instructions you're looking for.
To get started working on our infrastructure, follow the above instructions.
These instructions, by contrast, are for the initial setup of Symptomradar when no infrastructure previously exists.
- Comment out
backend "s3"
terraform init
terraform apply -target aws_s3_bucket.terraform_state -target aws_dynamodb_table.terraform_state_lock
- Uncomment
backend "s3"
terraform init
terraform apply -target module.env_dev.aws_s3_bucket.backend_code -target aws_route53_zone.oiretutka_fi
./scripts/deploy-backend dev-tmp
(fails with an error about function missing; this is fine for now)terraform apply
./scripts/deploy-frontend dev-tmp
Manual steps required:
- For reasons unknown, the Athena result bucket needs to be set manually, even if it's defined in the Terraform config. For the
dev
env for instance, it'd bes3://symptomradar-dev-storage-results/
. - The setup also has CloudFront additional metrics enabled. Currently, this cannot be done through CLI or Terraform.
- It also creates an IAM user for deploying Lambdas and uploading to S3. However, access keys needs to be created using AWS Console.
- Some secrets are managed outside of Terraform, so they don't end up as plain-text in the state file. Set up the global secret pepper used for hashing
participant_id
before persistence:read SECRET && aws ssm put-parameter --type "SecureString" --name "/symptomradar/dev/secret-pepper" --value "$SECRET"
read SECRET && aws ssm put-parameter --type "SecureString" --name "/symptomradar/prod/secret-pepper" --value "$SECRET"