From 5f9cfe03570e23776819f9462261f4a295705ae3 Mon Sep 17 00:00:00 2001 From: "Jonathan Hess (he/him)" <103529393+hessjcg@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:59:44 -0700 Subject: [PATCH] docs: Describe environment variable configuration in the README. (#2264) Fixes #2263 --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae7a4fbd1..cf5bfe827 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The Cloud SQL Auth Proxy has support for: - [HTTP Healthchecks][health-check-example] - Service account impersonation - Separate Dialer functionality released as the [Cloud SQL Go Connector][go connector] -- Configuration with environment variables +- Configuration with [environment variables](#config-environment-variables) - Fully POSIX-compliant flags If you're using Go, Java, Python, or Node.js, consider using the corresponding Cloud SQL @@ -373,6 +373,24 @@ debug-logs = true Run `./cloud-sql-proxy --help` for more details. +### Config environment variables + +The proxy supports configuration through environment variables. +Each environment variable uses "CSQL_PROXY" as a prefix and is +the uppercase version of the flag using underscores as word delimiters. + +For example, the `--auto-iam-authn` flag may be set with the environment variable +`CSQL_PROXY_AUTO_IAM_AUTHN`. + +An invocation of the Proxy using environment variables would look like the following: + +```shell +CSQL_PROXY_AUTO_IAM_AUTHN=true \ + ./cloud-sql-proxy +``` + +Run `./cloud-sql-proxy --help` for more details. + ### Configuring a Lazy Refresh The `--lazy-refresh` flag configures the Proxy to retrieve connection info