Skip to main content

connect

Creates, updates, deletes, gets or lists a connect resource.

Overview

Nameconnect
TypeResource
Idgoogle.sqladmin.connect

Fields

NameDatatypeDescription
backendTypestringSECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tier property in the settings object to determine the database type.
databaseVersionstringThe database engine type and version. The databaseVersion field cannot be changed after instance creation. MySQL instances: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12 (default), POSTGRES_13, or POSTGRES_14. SQL Server instances: SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, SQLSERVER_2017_WEB, SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB.
dnsNamestringThe dns name of the instance.
ipAddressesarrayThe assigned IP addresses for the instance.
kindstringThis is always sql#connectSettings.
pscEnabledbooleanWhether PSC connectivity is enabled for this instance.
regionstringThe cloud region for the instance. For example, us-central1, europe-west1. The region cannot be changed after instance creation.
serverCaCertobjectSslCerts Resource
serverCaModestringSpecify what type of CA is used for the server certificate.

Methods

NameAccessible byRequired ParamsDescription
getSELECTinstance, projectRetrieves connect settings about a Cloud SQL instance.
generate_ephemeralEXECinstance, projectGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

SELECT examples

Retrieves connect settings about a Cloud SQL instance.

SELECT
backendType,
databaseVersion,
dnsName,
ipAddresses,
kind,
pscEnabled,
region,
serverCaCert,
serverCaMode
FROM google.sqladmin.connect
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';