Skip to main content

connect

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

Overview

Nameconnect
TypeResource
Idgoogle.sqladmin.connect

Fields

The following fields are returned by SELECT queries:

Successful response

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.
customSubjectAlternativeNamesarrayCustom subject alternative names for the server certificate.
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.
dnsNamesarrayOutput only. The list of DNS names used by this instance.
ipAddressesarrayThe assigned IP addresses for the instance.
kindstringThis is always sql#connectSettings.
mdxProtocolSupportarrayOptional. Output only. mdx_protocol_support controls how the client uses metadata exchange when connecting to the instance. The values in the list representing parts of the MDX protocol that are supported by this instance. When the list is empty, the instance does not support MDX, so the client must not send an MDX request. The default is empty.
nodeCountinteger (int32)The number of read pool nodes in a read pool.
nodesarrayOutput only. Entries containing information about each read pool node of the read pool.
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 (id: SslCert)
serverCaModestringSpecify what type of CA is used for the server certificate.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, instancereadTimeRetrieves connect settings about a Cloud SQL instance.
generate_ephemeralexecproject, instanceGenerates 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instancestring
projectstring
readTimestring (google-datetime)

SELECT examples

Retrieves connect settings about a Cloud SQL instance.

SELECT
backendType,
customSubjectAlternativeNames,
databaseVersion,
dnsName,
dnsNames,
ipAddresses,
kind,
mdxProtocolSupport,
nodeCount,
nodes,
pscEnabled,
region,
serverCaCert,
serverCaMode
FROM google.sqladmin.connect
WHERE project = '{{ project }}' -- required
AND instance = '{{ instance }}' -- required
AND readTime = '{{ readTime }}';

Lifecycle Methods

Generates 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.

EXEC google.sqladmin.connect.generate_ephemeral 
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"public_key": "{{ public_key }}",
"access_token": "{{ access_token }}",
"readTime": "{{ readTime }}",
"validDuration": "{{ validDuration }}"
}';