Skip to content

Add-on Environment Variables

When you attach an add-on, Watasu injects connection details into your app as config vars. This page lists them per add-on. Read these like any other config var (watasu config --app my-app), but don’t overwrite them — the add-on resets them on its next reconcile.

VariablePurpose
DATABASE_URLFull Postgres connection string
PGHOSTHostname
PGPORTPort
PGDATABASEDatabase name
PGUSERUsername
PGPASSWORDPassword

DATABASE_URL is what most ORMs and frameworks read. The discrete PG* variables are for tools (psql, pg_dump) and code that builds connections programmatically.

VariablePurpose
REDIS_URLRedis-protocol connection URL

The REDIS_URL name is intentional — Valkey speaks the Redis protocol, and existing libraries that look for REDIS_URL work unchanged.

Object storage exports a wide set of S3-compatible variables so that whichever name your SDK looks for, it finds:

VariablePurpose
S3_BUCKETBucket name (legacy/short form)
AWS_S3_BUCKETBucket name (AWS-style)
AWS_ACCESS_KEY_IDCredential ID
AWS_SECRET_ACCESS_KEYCredential secret
AWS_ENDPOINT_URLEndpoint (this isn’t AWS — it’s the Watasu-managed S3-compatible endpoint)
AWS_ENDPOINT_URL_S3Same as above, S3-specific override
AWS_REGIONRegion label expected by AWS SDKs
AWS_DEFAULT_REGIONSame value, alternate name some SDKs read
AWS_S3_REGIONSame value, S3-specific override
AWS_S3_URLConvenience URL combining bucket + endpoint

Most SDKs (boto3, aws-sdk-*, rclone, minio, etc.) pick these up automatically.

ClickHouse exports a connection URL plus discrete connection components. Use a standard ClickHouse client library; it’ll find what it needs.

Redpanda exports broker addresses and SASL credentials. Use any Kafka-compatible client library.

When you attach an add-on with --as <ALIAS>, every variable that add-on would normally export gets prefixed with ALIAS_:

Terminal window
watasu addons:attach reporting-db --app my-app --as REPORTING

Now your app sees both:

  • DATABASE_URL — the original primary
  • REPORTING_DATABASE_URL — the new alias

This is how you give one app multiple databases of the same kind, and it’s how PostgreSQL CLI commands target a specific database (watasu pg:psql REPORTING_DATABASE_URL).