Creates a postgres (GCP Cloud SQL) database instance

This module creates a postgres GCP Cloud SQL database. It is made with the private service access, ensuring private communication.


Opta will provision your database with 7 days of automatic daily backups in the form of Cloud SQL Backups. You can find them either programmatically via the gcloud cli, or through the GCP web console inside your db description page.


When linked to a k8s-service, it adds connection credentials to your container’s environment variables as:

  • {module_name}_db_user
  • {module_name}_db_password
  • {module_name}_db_name
  • {module_name}_db_host

In the modules reference example, the {module_name} would be replaced with rds

The permission list can optionally have one entry which should be a map for renaming the default environment variable names to a user-defined value:

  - db:
      - db_user: DBUSER
        db_host: DBHOST
        db_name: DBNAME
        db_password: DBPASS

If present, this map must have renames for all 4 fields.


Name Description Default Required
instance_tier This is the RDS instance type used for the cloud sql instance instances. db-f1-micro False
safety Set to “true”, if you want to disable the database deletion in Opta. You would have to manually set this “false” to enable DB deletion. False False
engine_version The version of the database to use. 11 False