Skip to main content

connection_certificates

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

Overview​

Nameconnection_certificates
TypeResource
Idfivetran.certificates.connection_certificates

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the certificate (Base64URL encoded hash of the certificate). (example: Y29ubmVjdG9yIGNlcnRpZmljYXRlIGhhc2g)
namestringThe certificate name. (example: Certificate Name)
hashstringHash of the certificate. (example: jhg5UI7fgrI6yy...)
public_keystringThe certificate decoded public key. (example: Sun RSA public key, 2048 bits params: null modulus: 7685655455... public exponent: 65537)
sha_1stringSHA1 of certificate. (example: c8de1d13vtu435ilj435lj345796d8jh7hk8hgk) (wire: sha1)
sha_256stringSHA256 of certificate. (example: 5vt6rt6jtr654eef94ec3f91122a623b389f4d331ff330026e43af21013vb45f) (wire: sha256)
typestringType of the certificate. (example: TLS)
validated_bystringThe unique identified for the user who has approved the certificate. (example: user_id)
validated_datestring (date-time)Date when certificate has been validated and approved. (example: 2023-08-20T10:15:20.677566Z)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectconnection_id, hashReturns details of the certificate approved for the specified connection with specified certificate hash.
listselectconnection_idcursor, limitReturns the list of approved certificates for the specified connection.
createinsertconnection_id, encoded_cert, hashApproves a certificate, so Fivetran trusts this certificate for a source database connection. <br />The connection setup tests will fail if a non-approved certificate is provided.<br /><br />> NOTE: This is only required for source connections based on the following databases: <br />> - [MySQL](https:​//fivetran.com/docs/connectors/databases/mysql#supportedservices)<br />> - [PostgreSQL](https:​//fivetran.com/docs/connectors/databases/postgresql#supportedservices)<br />> - [SQLServer](https:​//fivetran.com/docs/connectors/databases/sql-server#supportedservices)<br />
deletedeleteconnection_id, hashRevokes a certificate, so Fivetran no longer trusts it while connecting to the source 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
connection_idstringThe unique identifier of the connection. Retrieve it from the id field in the [List All Connections](https:​//fivetran.com/docs/rest-api/api-reference/connections/list-connections) response, or from the id field returned when you [Create a Connection](https:​//fivetran.com/docs/rest-api/api-reference/connections/create-connection).
hashstringThe unique identifier of the certificate (Base64URL encoded hash of the certificate).
cursorstringPaging cursor, [read more about pagination](https:​//fivetran.com/docs/rest-api/pagination)
limitinteger (int32)Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100.

SELECT examples​

Returns details of the certificate approved for the specified connection with specified certificate hash.

SELECT
id,
name,
hash,
public_key,
sha_1,
sha_256,
type,
validated_by,
validated_date
FROM fivetran.certificates.connection_certificates
WHERE connection_id = '{{ connection_id }}' -- required
AND hash = '{{ hash }}' -- required
;

INSERT examples​

Approves a certificate, so Fivetran trusts this certificate for a source database connection. <br />The connection setup tests will fail if a non-approved certificate is provided.<br /><br />> NOTE: This is only required for source connections based on the following databases: <br />> - [MySQL](https:​//fivetran.com/docs/connectors/databases/mysql#supportedservices)<br />> - [PostgreSQL](https:​//fivetran.com/docs/connectors/databases/postgresql#supportedservices)<br />> - [SQLServer](https:​//fivetran.com/docs/connectors/databases/sql-server#supportedservices)<br />

INSERT INTO fivetran.certificates.connection_certificates (
hash,
encoded_cert,
connection_id
)
SELECT
'{{ hash }}' /* required */,
'{{ encoded_cert }}' /* required */,
'{{ connection_id }}'
RETURNING
id,
name,
hash,
public_key,
sha_1,
sha_256,
type,
validated_by,
validated_date
;

DELETE examples​

Revokes a certificate, so Fivetran no longer trusts it while connecting to the source database.

DELETE FROM fivetran.certificates.connection_certificates
WHERE connection_id = '{{ connection_id }}' --required
AND hash = '{{ hash }}' --required
;