Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Describe environment variable configuration in the README. #2264

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -373,6 +373,22 @@ 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:
Comment on lines +380 to +383
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
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 my-project:us-central1:my-db-server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use either INSTANCE_CONNECTION_NAME or myproject:my-region:myinstance for consistency

Suggested change
./cloud-sql-proxy my-project:us-central1:my-db-server
./cloud-sql-proxy <INSTANCE_CONNECTION_NAME>

```

Run `./cloud-sql-proxy --help` for more details.

### Configuring a Lazy Refresh

The `--lazy-refresh` flag configures the Proxy to retrieve connection info
Expand Down
Loading