This is a Terraform configuration for deploying the Actual Budget server to a Cloud Run service in GCP, which should stay under the always free tier with normal usage (as long as you are not syncing with the server for ~2 hours per day).
Free tier limits for the services used:
- Cloud Run
- 2 million requests per month
- 360,000 GB-seconds of memory, 180,000 vCPU-seconds of compute time
- 1 GB of outbound data transfer from North America per month
- This only applies if you access the site directly through the Cloud Run service URL. If you use the Firebase Hosting URL, connections are routed to North America before reaching the Cloud Run service, so this limit is not reached.
- Cloud Storage
- 5 GB-months of regional storage (US regions only) per month
- Firebase Hosting
- 360 MB/day ($0.15/GB thereafter)
- IMPORTANT: Exporting data from Actual Budget will count towards this limit. If you have over 10 years of transactions, consider downloading the budget files directly from the Cloud Storage bucket instead.
- 360 MB/day ($0.15/GB thereafter)
References:
- https://cloud.google.com/free/docs/free-cloud-features
- https://firebase.google.com/docs/hosting/usage-quotas-pricing
- https://firebase.google.com/pricing
- Terraform CLI
- Google Cloud CLI
- HCP Terraform account with a workspace created (ensure the "Execution Mode" is set to "Local".)
- In provider.tf, set the
organization
andworkspace
to your HCP organization and workspace. - Create a new project in Google Cloud Console.
- Create a new Firebase project in the Firebase Console.
- https://console.firebase.google.com/u/0/?pli=1
- Select "Get started with a Firebase project"
- Select "Already have a Google Cloud project? Add Firebase to Google Cloud project"
- Choose the project you created above
- Find your project ID and billing account ID.
- Create a
tfvars.auto.tfvars
file in the root of the project with the following variables:Theproject_id = "your-project-id" billing_account_id = "your-billing-account-id" currency_code = "your-currency-code" project_name = "your-project-name"
project_name
can be anything you want. - Run
gcloud auth application-default login
to authenticate with Google Cloud. - Run
terraform init
to initialize the project. - Run
terraform apply
to deploy the project. - Once the deployment is complete, you should see "firebase_hosting_url = ..." in the output. That is the URL you should use to access the Actual Budget site.
If you wish to update the version of Actual Budget that the Cloud Run service is running:
- Run
terraform apply -replace="module.cloud_run.google_cloud_run_v2_service.main"
- Then, run
terraform apply
to update other resources.
- Added support for Firebase Hosting.
- Renamed
cloud_run_service_name
toproject_name
, please update yourtfvars.auto.tfvars
file.