cloud-sql-pgbouncer

christippett/cloud-sql-pgbouncer/google

Terraform Module HCL GOOGLE

Automatically configure and deploy PgBouncer on Google Cloud with this Terraform module

Install
module "cloud-sql-pgbouncer" {
source = "christippett/cloud-sql-pgbouncer/google"
version = "1.2.1"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform PgBouncer for Cloud SQL ![GitHub tag (latest SemVer)](./CHANGELOG.md) ![Terraform Registry](https://registry.terraform.io/modules/christippett/cloud-sql-pgbouncer/) Let Cloud Run wild on your database 🐆 Overview This module creates a Compute Engine instance running PgBouncer that sits in front of a Cloud SQL or self-hosted PostgreSQL instance. Refer to the examples/ sub-directory for a complete example of how this module can be integrated and used with Cloud SQL. ``hcl module "pgbouncer" { source = "christippett/cloud-sql-pgbouncer/google" version = "~>1.2" project = var.project name = "pgbouncer" zone = "us-central1-a" subnetwork = "subnet-1" machine_type = "f1-micro" port = 25128 database_host = 5432 users = [ { name = "admin", password = "password", admin = true }, { name = "u

Inputs (24)
NameTypeDescriptionDefault
projectstringThe ID of the project where PgBouncer will be created. required
database_hoststringThe host address of the Cloud SQL instance to connect to. required
zonestringThe zone where PgBouncer will be created. required
portnumberThe port used by PgBouncer to listen on. required
userslist(string)The list of users to be created in PgBouncer's userlist.txt. Passwords can be pr required
namestringThe name of the PgBouncer instance. required
auth_userstringAny user not specified in `users` will be queried through the `auth_query` querynull
pool_modestringSpecifies when a server connection can be reused by other clients. Possible valu"transaction"
subnetworkstringThe name or self-link of the subnet where PgBouncer will be created. Either netwnull
public_ip_addressstringThe public IP address to assign to the PgBouncer instance. If not given, one wilnull
machine_typestringThe machine type of PgBouncer instances."f1-micro"
service_account_scopesstringA list of service scopes to apply to the PgBouncer instance. Default is the fullnull
disable_service_accountboolFlag to disable attaching a service account to the PgBouncer instance.false
auth_querystringQuery to load user’s password from database.null
max_client_connectionsnumberMaximum number of client connections allowed.100
disable_public_ipboolFlag to disable the PgBouncer instance from being assigned an external, public Ifalse
pgbouncer_custom_configstringCustom PgBouncer configuration values to be appended to `pgbouncer.ini`.""
pgbouncer_image_tagstringThe tag to use for the base PgBouncer `edoburu/pgbouncer` Docker image used by t"latest"
tagslist(string)A list of tags to assign to PgBouncer instances.[]
default_pool_sizenumberMaximum number of server connections to allow per user/database pair.20
max_db_connectionsnumberThe maximum number of server connections per database (regardless of user). 0 is0
boot_imagestringThe boot image used by PgBouncer instances. Defaults to the latest LTS Container"cos-cloud/cos-89-lts"
service_account_emailstringThe service account e-mail address. If not given, the default Google Compute Engnull
module_depends_onlist(any)List of modules or resources this module depends on.[]
Outputs (4)
instance_name — The name for the PgBouncer instance.
private_ip_address — The first private IPv4 address assigned to the PgBouncer instance.
public_ip_address — The first public IPv4 address assigned for the PgBouncer instance.
port — The port number PgBouncer listens on.
Resources (2)
google_compute_instancenull_resource
Details
FrameworkTerraform Module
LanguageHCL
Version1.2.1
Cloud GOOGLE
★ Stars49
Forks23
Total downloads6.2k
Inputs24
Outputs4
Resources2
Examples1
Submodules1
LicenseMIT
Namespacechristippett
Updated