Skip to main content

destination_certificates

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

Overview​

Namedestination_certificates
TypeResource
Idfivetran.certificates.destination_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
getselectdestination_id, hashReturns details of the certificate approved for the specified destination with specified certificate hash.
listselectdestination_idcursor, limitReturns the list of approved certificates for the specified destination.
createinsertdestination_id, encoded_cert, hashApproves a certificate, so Fivetran trusts this certificate for a destination database connection. <br />The destination connection setup tests will fail if a non-approved certificate is provided.<br /><br />> NOTE: This is only required for destination connections based on the following databases: <br />> - [MySQL](https:​//fivetran.com/docs/destinations/mysql#supportedimplementations)<br />> - [PostgreSQL](https:​//fivetran.com/docs/destinations/postgresql#supportedimplementations)<br />> - [SQLServer](https:​//fivetran.com/docs/destinations/sql-server#supportedimplementations)<br />
deletedeletedestination_id, hashRevokes a certificate, so Fivetran no longer trusts it while connecting to the destination 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
destination_idstringThe unique identifier for the destination within the Fivetran system.
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 destination with specified certificate hash.

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

INSERT examples​

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

INSERT INTO fivetran.certificates.destination_certificates (
hash,
encoded_cert,
destination_id
)
SELECT
'{{ hash }}' /* required */,
'{{ encoded_cert }}' /* required */,
'{{ destination_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 destination database.

DELETE FROM fivetran.certificates.destination_certificates
WHERE destination_id = '{{ destination_id }}' --required
AND hash = '{{ hash }}' --required
;