Skip to content

Commit a2a625e

Browse files
authored
Rename CLOUD_SQL_CONNECTION_NAME to INSTANCE_CONNECTION_NAME (GoogleCloudPlatform#1552)
1 parent 9f19055 commit a2a625e

File tree

10 files changed

+18
-19
lines changed

10 files changed

+18
-19
lines changed

cloud_sql/mysql/pdo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Use these terminal commands to initialize other environment variables as well:
5050

5151
```bash
5252
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
53-
export CLOUD_SQL_CONNECTION_NAME='::'
53+
export INSTANCE_CONNECTION_NAME='::'
5454
export DB_USER=''
5555
export DB_PASS=''
5656
export DB_NAME=''
@@ -64,7 +64,7 @@ safe.
6464
Then use the following command to launch the proxy in the background:
6565

6666
```bash
67-
./cloud_sql_proxy -dir=$DB_SOCKET_DIR --instances=$CLOUD_SQL_CONNECTION_NAME --credential_file=$GOOGLE_APPLICATION_CREDENTIALS &
67+
./cloud_sql_proxy -dir=$DB_SOCKET_DIR --instances=$INSTANCE_CONNECTION_NAME --credential_file=$GOOGLE_APPLICATION_CREDENTIALS &
6868
```
6969

7070
### TCP mode
@@ -76,7 +76,7 @@ Use these terminal commands to initialize environment variables:
7676

7777
```bash
7878
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
79-
export CLOUD_SQL_CONNECTION_NAME='::'
79+
export INSTANCE_CONNECTION_NAME='::'
8080
export DB_HOST='127.0.0.1'
8181
export DB_USER=''
8282
export DB_PASS=''
@@ -91,7 +91,7 @@ safe.
9191
Then use the following command to launch the proxy in the background:
9292

9393
```bash
94-
./cloud_sql_proxy -instances=$CLOUD_SQL_CONNECTION_NAME=tcp:3306 -credential_file=$GOOGLE_APPLICAITON_CREDENTIALS &
94+
./cloud_sql_proxy -instances=$INSTANCE_CONNECTION_NAME=tcp:3306 -credential_file=$GOOGLE_APPLICAITON_CREDENTIALS &
9595
```
9696

9797
#### Windows/PowerShell

cloud_sql/mysql/pdo/app.flex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env: flex
1919
# something like https://cloud.google.com/secret-manager/ to help keep secrets
2020
# secret.
2121
env_variables:
22-
CLOUD_SQL_CONNECTION_NAME: "::"
22+
INSTANCE_CONNECTION_NAME: "::"
2323
DB_USER: my-db-user
2424
DB_PASS: my-db-pass
2525
DB_NAME: my-db

cloud_sql/mysql/pdo/app.standard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runtime: php74
1717
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
1818
# something like https://cloud.google.com/secret-manager/ to help keep secrets secret.
1919
env_variables:
20-
CLOUD_SQL_CONNECTION_NAME: ::<MY-DATABASE>
20+
INSTANCE_CONNECTION_NAME: ::<INSTANCE-NAME>
2121
DB_USER: my-db-user
2222
DB_PASS: my-db-pass
2323
DB_NAME: my-db

cloud_sql/mysql/pdo/src/DBInitializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static function initUnixDatabaseConnection(
104104
// $username = 'your_db_user';
105105
// $password = 'yoursupersecretpassword';
106106
// $dbName = 'your_db_name';
107-
// $connectionName = getenv("CLOUD_SQL_CONNECTION_NAME");
107+
// $connectionName = getenv("INSTANCE_CONNECTION_NAME");
108108
// $socketDir = getenv('DB_SOCKET_DIR') ?: '/cloudsql';
109109

110110
// Connect using UNIX sockets

cloud_sql/postgres/pdo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Use these terminal commands to initialize other environment variables as well:
5252

5353
```bash
5454
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
55-
export CLOUD_SQL_CONNECTION_NAME='::'
55+
export INSTANCE_CONNECTION_NAME='::'
5656
export DB_USER=''
5757
export DB_PASS=''
5858
export DB_NAME=''
@@ -66,7 +66,7 @@ safe.
6666
Then use the following command to launch the proxy in the background:
6767

6868
```bash
69-
./cloud_sql_proxy -dir=$DB_SOCKET_DIR --instances=$CLOUD_SQL_CONNECTION_NAME --credential_file=$GOOGLE_APPLICATION_CREDENTIALS &
69+
./cloud_sql_proxy -dir=$DB_SOCKET_DIR --instances=$INSTANCE_CONNECTION_NAME --credential_file=$GOOGLE_APPLICATION_CREDENTIALS &
7070
```
7171

7272
### TCP mode
@@ -80,7 +80,7 @@ Use these terminal commands to initalie environment variables:
8080

8181
```bash
8282
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
83-
export CLOUD_SQL_CONNECTION_NAME='::'
83+
export INSTANCE_CONNECTION_NAME='::'
8484
export DB_HOST='127.0.0.1'
8585
export DB_USER=''
8686
export DB_PASS=''
@@ -95,7 +95,7 @@ safe.
9595
Then use the following command to launch the proxy in the background:
9696

9797
```bash
98-
./cloud_sql_proxy -instances=$CLOUD_SQL_CONNECTION_NAME=tcp:5432 -credential_file=$GOOGLE_APPLICAITON_CREDENTIALS &
98+
./cloud_sql_proxy -instances=$INSTANCE_CONNECTION_NAME=tcp:5432 -credential_file=$GOOGLE_APPLICAITON_CREDENTIALS &
9999
```
100100

101101
#### Windows/PowerShell

cloud_sql/postgres/pdo/app.flex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env: flex
1919
# something like https://cloud.google.com/secret-manager/ to help keep secrets
2020
# secret.
2121
env_variables:
22-
CLOUD_SQL_CONNECTION_NAME: "::"
22+
INSTANCE_CONNECTION_NAME: "::"
2323
DB_USER: my-db-user
2424
DB_PASS: my-db-pass
2525
DB_NAME: my-db

cloud_sql/postgres/pdo/app.standard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runtime: php74
1717
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
1818
# something like https://cloud.google.com/secret-manager/ to help keep secrets secret.
1919
env_variables:
20-
CLOUD_SQL_CONNECTION_NAME: ::
20+
INSTANCE_CONNECTION_NAME: ::
2121
DB_USER: my-db-user
2222
DB_PASS: my-db-pass
2323
DB_NAME: my-db

cloud_sql/postgres/pdo/src/DBInitializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function initTcpDatabaseConnection(
5858
sprintf(
5959
'Invalid or missing configuration! Make sure you have set ' .
6060
'$username, $password, $dbName, and $host (for TCP mode) ' .
61-
'or $cloud_sql_connection_name (for UNIX socket mode). ' .
61+
'or $connectionName (for UNIX socket mode). ' .
6262
'The PHP error was %s',
6363
$e->getMessage()
6464
),
@@ -104,7 +104,7 @@ public static function initUnixDatabaseConnection(
104104
// $username = 'your_db_user';
105105
// $password = 'yoursupersecretpassword';
106106
// $dbName = 'your_db_name';
107-
// $connectionName = getenv("CLOUD_SQL_CONNECTION_NAME");
107+
// $connectionName = getenv("INSTANCE_CONNECTION_NAME");
108108
// $socketDir = getenv('DB_SOCKET_DIR') ?: '/cloudsql';
109109

110110
// Connect using UNIX sockets

cloud_sql/sqlserver/pdo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
2121
To run the Cloud SQL proxy, you need to set the instance connection name. See the instructions [here](https://cloud.google.com/sql/docs/sqlserver/quickstart-proxy-test#get_the_instance_connection_name) for finding the instance connection name.
2222

2323
```bash
24-
export CLOUD_SQL_CONNECTION_NAME='::'
24+
export INSTANCE_CONNECTION_NAME='::'
2525
```
2626

2727
Once the proxy is ready, use one of the following commands to start the proxy in the background.
@@ -30,7 +30,7 @@ You may connect to your instance via TCP. To connect via TCP, you must provide a
3030

3131
```bash
3232
$ ./cloud_sql_proxy \
33-
--instances=$CLOUD_SQL_CONNECTION_NAME=tcp:1433 \
33+
--instances=$INSTANCE_CONNECTION_NAME=tcp:1433 \
3434
--credential_file=$GOOGLE_APPLICATION_CREDENTIALS
3535
```
3636

cloud_sql/sqlserver/pdo/src/DBInitializer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public static function initTcpDatabaseConnection(
5656
throw new RuntimeException(
5757
sprintf(
5858
'Invalid or missing configuration! Make sure you have set ' .
59-
'$username, $password, $dbName, and $dbHost (for TCP mode) ' .
60-
'or $cloud_sql_connection_name (for UNIX socket mode). ' .
59+
'$username, $password, $dbName, and $dbHost (for TCP mode).' .
6160
'The PHP error was %s',
6261
$e->getMessage()
6362
),

0 commit comments

Comments
 (0)