0
0
GCPcloud~10 mins

Cloud SQL Proxy for secure connections in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the Cloud SQL Proxy with the correct instance connection name.

GCP
cloud_sql_proxy -instances=[1]=tcp:5432
Drag options to blanks, or click blank then click option'
Amy-project:us-central1:my-instance
Bmy-instance:us-central1:my-project
Cus-central1:my-project:my-instance
Dmy-project:my-instance:us-central1
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of project, region, and instance.
Using slashes or dots instead of colons.
2fill in blank
medium

Complete the command to specify the credentials file for Cloud SQL Proxy.

GCP
cloud_sql_proxy -instances=my-project:us-central1:my-instance=tcp:5432 -credential_file=[1]
Drag options to blanks, or click blank then click option'
A/path/to/key.json
B/path/to/key.txt
C/path/to/key.yaml
D/path/to/key.pem
Attempts:
3 left
💡 Hint
Common Mistakes
Using a text or YAML file instead of JSON.
Using a certificate file (.pem) instead of credentials.
3fill in blank
hard

Fix the error in the command to run Cloud SQL Proxy on port 3306.

GCP
cloud_sql_proxy -instances=my-project:us-central1:my-instance=[1]
Drag options to blanks, or click blank then click option'
Atcp:3307
Btcp:3306
Cudp:3306
Dhttp:3306
Attempts:
3 left
💡 Hint
Common Mistakes
Using UDP or HTTP protocols instead of TCP.
Using the wrong port number.
4fill in blank
hard

Fill both blanks to create a command that runs Cloud SQL Proxy with instance connection and logs output to a file.

GCP
cloud_sql_proxy -instances=[1]=tcp:5432 > [2] 2>&1 &
Drag options to blanks, or click blank then click option'
Amy-project:us-central1:my-instance
Bproxy.log
Cerror.log
Dmy-instance:us-central1:my-project
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping project and instance in the connection name.
Using a non-log file name for output.
5fill in blank
hard

Fill all three blanks to create a Python dictionary comprehension that maps instance names to their ports if the port is greater than 5000.

GCP
ports = { [1]: [2] for [1], [2] in instances if [2] > 5000 }
Drag options to blanks, or click blank then click option'
Ainstance
Bport
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Using the key variable in the condition instead of the value.