This repository holds infrastructure as code. Terraform is used to provision the infrastructure.
You need to install the CLI tool for the cloud provider you are using:
python3 -m venv venv
source venv/bin/activate
make install_devIf you want to commit changes to scripts,
you need to install ShellCheck, e.g. with:
brew install shellcheckThis is a one-time setup. It is not part of this infra-as-code.
Populate the backend.conf with the required values.
Create a storage account and a container to store the Terraform state.
NOTE: It might be required to add the object_id of the principal running terraform apply to the key vault with Get key permissions.
A first deploy will typically fail because the Key Vault is not yet populated with the required secrets.
One can deploy the Key Vault separately:
terraform apply -target=azurerm_key_vault.key_vaultThen manually add the "db-password" secret in the Key Vault. Then run terraform apply again to finish the deployment.
Create a bucket to store the Terraform state.
Initialize (one-time setup) with
# NOTE: Populate the variables.
CSP= IDENTIFIER= bash scripts/init.sh.For local use, you can create symbolic links to the API and UI repository.
ln -s {absolute_path_to_api_repo} api
ln -s {absolute_path_to_ui_repo} uiThen use the deploy script to build and deploy the infrastructure:
# NOTE: Populate the variables.
CSP= IDENTIFIER= REGISTRY_NAME= REPOSITORY_NAME= bash scripts/deploy.sh- Run
alembic upgrade headagainst the database. - Populate with any data required. E.g., follow the instructions in the API repository.
- Create a separate backend, e.g.,
backend.conf, for each environment. - Create a separate
terraform.tfvarsfor each environment. - Use the
-backend-configflag withterraform initto specify the backend configuration file. - Use the
-var-fileflag withterraform planandterraform applyto specify the variables file.