Skip to content

Commit

Permalink
docs: Update migration-guide.md (#2021)
Browse files Browse the repository at this point in the history
Co-authored-by: Jack Wotherspoon <[email protected]>
  • Loading branch information
enocom and jackwotherspoon authored Nov 9, 2023
1 parent 10bec27 commit d9e07c1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,34 @@ but recognize in some legacy environments `--auto-ip` may be necessary.
./cloud-sql-proxy --address 0.0.0.0 --port 6000 <INSTANCE_CONNECTION_NAME>
```

## Environment variable changes

In v1 it was possible to do this:

``` shell
export INSTANCES="<INSTANCE_CONNECTION_NAME_1>=tcp:3306,<INSTANCE_CONNECTION_NAME_2>=tcp:5432"

./cloud_sql_proxy
```

In v2, we've significantly expanded the support for environment variables.
All flags can be set with an environment variable including instance connection names.

For example, in v2 this is possible:

``` shell
export CSQL_PROXY_INSTANCE_CONNECTION_NAME_0="<INSTANCE_CONNECTION_NAME_1>?port=3306"
export CSQL_PROXY_INSTANCE_CONNECTION_NAME_1="<INSTANCE_CONNECTION_NAME_2>?port=5432"

export CSQL_PROXY_AUTO_IAM_AUTHN=true

./cloud-sql-proxy
```

See the [help message][] for more details.

[help message]: https://github.com/GoogleCloudPlatform/cloud-sql-proxy/blob/10bec27e4d44c14fe9e68f25fef6c373324e8bab/cmd/root.go#L240-L264

## Flag Changes

The following table lists in alphabetical order v1 flags and their v2 version.
Expand Down

0 comments on commit d9e07c1

Please sign in to comment.