Giter Site home page Giter Site logo

terraform-google-retool's Introduction

Self-hosted Retool on GCP

Self-hosted Retool deployment on GCP backed by Cloud Run and SQL. Based on examples from Retool and their documentation.

Architecture

The purpose of this project is to run self-hosted Retool as cheap as possible in the cloud. This is not intended for production use, however, this code could serve as a base for a hardened deployment.

Deployment Steps

  • Create terraform.tfvars file with required variables.
  • Run terraform apply.
  • terracurl_request.exec will execute retool-jobs-runner Cloud Run job to apply database migrations.

Sample Terraform .tfvars File

project_id         = "your-project-id"
domain_name        = "retool.your-domain.com"
retool_image       = "docker.io/tryretool/backend"
retool_license_key = "retool-license-key"

Known Issues

  • The retool-jobs-runner job will show as failed due to the fact Cloud Run jobs are not designed to be long-running. The main purpose of this job is to run database migrations. After migrations are applied, the container will continue to run. You can verifiy the migrations have successfully run by searching the logs for Running database migrations... or Database migrations are up to date..

Requirements

Name Version
google 4.66.0
terracurl 1.1.0

Providers

Name Version
google 4.66.0
random 3.5.1
terracurl 1.1.0
time 0.9.1

Modules

Name Source Version
retool_api GoogleCloudPlatform/cloud-run/google 0.7.0
retool_database GoogleCloudPlatform/sql-db/google//modules/postgresql 15.0.0
retool_secrets GoogleCloudPlatform/secret-manager/google 0.1.1
retool_service_account terraform-google-modules/service-accounts/google 4.2.0

Resources

Name Type
google_cloud_run_v2_job.retool_jobs_runner resource
google_project_service.activate_apis resource
google_sql_user.retool_database_user resource
random_password.encryption_key resource
random_password.jwt_secret resource
random_password.password resource
terracurl_request.exec resource
time_sleep.wait_activate_apis resource
google_client_config.default data source
google_secret_manager_secret_version.retool_database_password data source

Inputs

Name Description Type Default Required
activate_apis The list of APIs & services to activate within the project. list(string)
[
"compute.googleapis.com",
"run.googleapis.com",
"secretmanager.googleapis.com",
"sqladmin.googleapis.com"
]
no
api_cpu Number of vCPUs allocated to each api container instance. string "1000m" no
api_max_instances Maximum number of api container instances. number 1 no
api_memory Memory to allocate to each api container instance. string "2Gi" no
api_min_instances Minimum number of api container instances. number 0 no
database_tier The machine type for the database instance. string "db-f1-micro" no
database_version The database version to use. string "POSTGRES_11" no
domain_name Verified domain name to map to api service. string null no
image_name Artifact Registry container image name for Retool. string "backend" no
jobs_runner_cpu Number of vCPUs allocated to the jobs-runner container instance. string "1000m" no
jobs_runner_memory Memory to allocate to the jobs-runner container instance. string "2Gi" no
project_id The project ID to deploy in. string n/a yes
region The region of the deployment. string "us-east1" no
repository_name Artifact Registry repository name. string "retool" no
retool_image Retool image from docker.io or Artifact Registry. string "docker.io/tryretool/backend" no
retool_license_key Retool license key. string "EXPIRED-LICENSE-KEY-TRIAL" no
zone The zone of the deployment. string "us-east1-b" no

Outputs

Name Description
url The DNS name of the Cloud Run service.

terraform-google-retool's People

Contributors

mscribellito avatar

Stargazers

Lautaro Araujo avatar

Watchers

 avatar James Cloos avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.