You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Reset all state (DB + Redis + Kafka topics)~/projects/deli/scripts/reset-state.sh
# Inject fake GPS position for customer tracking map test~/projects/deli/scripts/inject-gps.sh
# Then open: http://localhost:8100/customer/tracking?courierId=<id>
Terraform scripts provision cloud infrastructure for AWS and Azure under infra/terraform/.
Helm charts in infra/helm/deli-services/ are used to deploy the application into the cluster
regardless of cloud target.
What Terraform manages
Component
AWS
Azure
Kubernetes
EKS
AKS
PostgreSQL (courierdb)
RDS PostgreSQL 16
Azure DB for PostgreSQL Flexible Server
TimescaleDB (gpsdb)
Self-managed in EKS (Helm)
Azure DB for PostgreSQL Flexible Server + extension
# 1. Authenticate
aws configure
# 2. (Recommended) Create S3 backend for state — run once
aws s3api create-bucket --bucket deli-terraform-state --region eu-west-1 \
--create-bucket-configuration LocationConstraint=eu-west-1
aws dynamodb create-table --table-name deli-terraform-locks \
--attribute-definitions AttributeName=LockID,AttributeType=S \
--key-schema AttributeName=LockID,KeyType=HASH \
--billing-mode PAY_PER_REQUEST
# Then add the backend block to infra/terraform/aws/versions.tf (see file for instructions)# 3. Create secrets file (never commit this)cd infra/terraform/aws
cat > terraform.tfvars <<EOFdb_postgres_password = "your-strong-password"redis_auth_token = "your-token-min-16-chars"EOF# 4. Provision (~20-40 min)
terraform init
terraform plan
terraform apply
# 5. Connect kubectl
aws eks update-kubeconfig \
--name $(terraform output -raw eks_cluster_name) \
--region eu-west-1
# 6. Deploy TimescaleDB into EKS (AWS only — gpsdb is not on RDS)
helm upgrade --install deli-platform infra/helm/deli-platform \
--namespace deli --create-namespace \
--set timescaledb.auth.password=your-gps-db-password \
--set postgresql.enabled=false \
--set redis.enabled=false \
--set kafka.enabled=false \
--set minio.enabled=false
# 7. Deploy application services (use terraform output values for connection strings)
helm upgrade --install deli-services infra/helm/deli-services \
--namespace deli \
--set global.postgresPassword=your-postgres-password \
--set global.redisPassword=your-redis-token \
...
Deploying to Azure
# 1. Authenticate
az login
az account set --subscription <subscription-id># 2. Create secrets file (never commit this)cd infra/terraform/azure
cat > terraform.tfvars <<EOFdb_admin_password = "your-strong-password"EOF# 3. Provision (~15-30 min)
terraform init
terraform plan
terraform apply
# 4. Connect kubectl
az aks get-credentials \
--name $(terraform output -raw aks_cluster_name) \
--resource-group deli-production
# 5. Deploy application services (TimescaleDB is fully managed on Azure)
helm upgrade --install deli-services infra/helm/deli-services \
--namespace deli --create-namespace \
--set global.postgresPassword=your-db-admin-password \
--set global.redisPassword=$(terraform output -raw redis_primary_access_key) \
...
# No deli-platform chart needed — all infrastructure is managed by Azure
Inspecting outputs
terraform output # show all outputs
terraform output rds_courierdb_endpoint # AWS: DB host
terraform output msk_bootstrap_brokers_sasl_iam # AWS: Kafka brokers
terraform output postgresql_courierdb_fqdn # Azure: DB FQDN
terraform output eventhubs_bootstrap_server # Azure: Kafka bootstrap server
Destroying infrastructure
# WARNING: this deletes all cloud resources including databases
terraform destroy
RDS deletion protection is enabled by default — you must disable it manually in the AWS console
or via terraform apply -var="..." before terraform destroy will succeed on the database.