Skip to content

Commit cf283cf

Browse files
author
Saketram Durbha
committed
replace references in Cloud SQL samples to Key Management Service to Secret Manager
1 parent 17298c5 commit cf283cf

File tree

10 files changed

+34
-17
lines changed

10 files changed

+34
-17
lines changed

cloud-sql/mysql/sqlalchemy/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export DB_PASS='<DB_PASSWORD>'
4242
export DB_NAME='<DB_NAME>'
4343
```
4444
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
45-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
45+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
46+
help keep secrets safe.
4647

4748
Then use this command to launch the proxy in the background:
4849
```bash
@@ -59,7 +60,8 @@ $env:DB_PASS="<DB_PASSWORD>"
5960
$env:DB_NAME="<DB_NAME>"
6061
```
6162
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
62-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
63+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
64+
help keep secrets safe.
6365

6466
Then use this command to launch the proxy in a separate PowerShell session:
6567
```powershell
@@ -92,7 +94,8 @@ export DB_PASS='<DB_PASSWORD>'
9294
export DB_NAME='<DB_NAME>'
9395
```
9496
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
95-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
97+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
98+
help keep secrets safe.
9699

97100
Then use this command to launch the proxy in the background:
98101
```bash

cloud-sql/mysql/sqlalchemy/app.flexible.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ beta_settings:
2929
cloud_sql_instances: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>=tcp:<PORT>
3030

3131
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
32-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
32+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
33+
# secrets secret.
3334
env_variables:
3435
CLOUD_SQL_CONNECTION_NAME: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>
3536
DB_USER: my-db-user

cloud-sql/mysql/sqlalchemy/app.standard.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
runtime: python37
1616

1717
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
18-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
18+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
19+
# secrets secret.
1920
env_variables:
2021
CLOUD_SQL_CONNECTION_NAME: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>
2122
DB_USER: my-db-user

cloud-sql/mysql/sqlalchemy/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def init_connection_engine():
6262
def init_tcp_connection_engine(db_config):
6363
# [START cloud_sql_mysql_sqlalchemy_create_tcp]
6464
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
65-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
65+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
66+
# secrets secret.
6667
db_user = os.environ["DB_USER"]
6768
db_pass = os.environ["DB_PASS"]
6869
db_name = os.environ["DB_NAME"]
@@ -96,7 +97,8 @@ def init_tcp_connection_engine(db_config):
9697
def init_unix_connection_engine(db_config):
9798
# [START cloud_sql_mysql_sqlalchemy_create_socket]
9899
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
99-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
100+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
101+
# secrets secret.
100102
db_user = os.environ["DB_USER"]
101103
db_pass = os.environ["DB_PASS"]
102104
db_name = os.environ["DB_NAME"]

cloud-sql/postgres/sqlalchemy/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export DB_PASS='<DB_PASSWORD>'
4141
export DB_NAME='<DB_NAME>'
4242
```
4343
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
44-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
44+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
45+
help keep secrets safe.
4546

4647
Then use this command to launch the proxy in the background:
4748
```bash
@@ -58,7 +59,8 @@ $env:DB_PASS="<DB_PASSWORD>"
5859
$env:DB_NAME="<DB_NAME>"
5960
```
6061
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
61-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
62+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
63+
help keep secrets safe.
6264

6365
Then use this command to launch the proxy in a separate PowerShell session:
6466
```powershell
@@ -90,7 +92,8 @@ export DB_PASS='<DB_PASSWORD>'
9092
export DB_NAME='<DB_NAME>'
9193
```
9294
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
93-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
95+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
96+
help keep secrets safe.
9497
9598
Then use this command to launch the proxy in the background:
9699
```bash

cloud-sql/postgres/sqlalchemy/app.flexible.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ beta_settings:
2929
cloud_sql_instances: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>=tcp:<PORT>
3030

3131
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
32-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
32+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
33+
# secrets secret.
3334
env_variables:
3435
CLOUD_SQL_CONNECTION_NAME: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>
3536
DB_USER: my-db-user

cloud-sql/postgres/sqlalchemy/app.standard.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
runtime: python37
1616

1717
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
18-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
18+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
19+
# secrets secret.
1920
env_variables:
2021
CLOUD_SQL_CONNECTION_NAME: <MY-PROJECT>:<INSTANCE-REGION>:<MY-DATABASE>
2122
DB_USER: my-db-user

cloud-sql/postgres/sqlalchemy/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def init_connection_engine():
6565
def init_tcp_connection_engine(db_config):
6666
# [START cloud_sql_postgres_sqlalchemy_create_tcp]
6767
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
68-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
68+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
69+
# secrets secret.
6970
db_user = os.environ["DB_USER"]
7071
db_pass = os.environ["DB_PASS"]
7172
db_name = os.environ["DB_NAME"]
@@ -99,7 +100,8 @@ def init_tcp_connection_engine(db_config):
99100
def init_unix_connection_engine(db_config):
100101
# [START cloud_sql_postgres_sqlalchemy_create_socket]
101102
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
102-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
103+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
104+
# secrets secret.
103105
db_user = os.environ["DB_USER"]
104106
db_pass = os.environ["DB_PASS"]
105107
db_name = os.environ["DB_NAME"]

cloud-sql/sql-server/sqlalchemy/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export DB_NAME='my_db'
4646
export DB_HOST='127.0.0.1:1433'
4747
```
4848
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
49-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
49+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
50+
help keep secrets safe.
5051

5152
Then, use the following command to start the proxy in the background using TCP:
5253
```bash
@@ -64,7 +65,8 @@ $env:DB_NAME="my_db"
6465
$env:DB_HOST="127.0.0.1:1433"
6566
```
6667
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
67-
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
68+
secure solution such as [Secret Manager](https://cloud.google.com/secret-manager/docs/overview) to
69+
help keep secrets safe.
6870

6971
Then use this command to launch the proxy in a separate PowerShell session:
7072
```powershell

cloud-sql/sql-server/sqlalchemy/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
def init_tcp_connection_engine():
3434
# [START cloud_sql_server_sqlalchemy_create_tcp]
3535
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
36-
# something like https://cloud.google.com/kms/ to help keep secrets secret.
36+
# something like https://cloud.google.com/secret-manager/docs/overview to help keep
37+
# secrets secret.
3738
db_user = os.environ["DB_USER"]
3839
db_pass = os.environ["DB_PASS"]
3940
db_name = os.environ["DB_NAME"]

0 commit comments

Comments
 (0)