destination_certificates
Creates, updates, deletes, gets or lists a destination_certificates resource.
Overview
| Name | destination_certificates |
| Type | Resource |
| Id | fivetran.certificates.destination_certificates |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the certificate (Base64URL encoded hash of the certificate). (example: Y29ubmVjdG9yIGNlcnRpZmljYXRlIGhhc2g) |
name | string | The certificate name. (example: Certificate Name) |
hash | string | Hash of the certificate. (example: jhg5UI7fgrI6yy...) |
public_key | string | The certificate decoded public key. (example: Sun RSA public key, 2048 bits params: null modulus: 7685655455... public exponent: 65537) |
sha_1 | string | SHA1 of certificate. (example: c8de1d13vtu435ilj435lj345796d8jh7hk8hgk) (wire: sha1) |
sha_256 | string | SHA256 of certificate. (example: 5vt6rt6jtr654eef94ec3f91122a623b389f4d331ff330026e43af21013vb45f) (wire: sha256) |
type | string | Type of the certificate. (example: TLS) |
validated_by | string | The unique identified for the user who has approved the certificate. (example: user_id) |
validated_date | string (date-time) | Date when certificate has been validated and approved. (example: 2023-08-20T10:15:20.677566Z) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the certificate (Base64URL encoded hash of the certificate). (example: Y29ubmVjdG9yIGNlcnRpZmljYXRlIGhhc2g) |
name | string | The certificate name. (example: Certificate Name) |
hash | string | Hash of the certificate. (example: jhg5UI7fgrI6yy...) |
public_key | string | The certificate decoded public key. (example: Sun RSA public key, 2048 bits params: null modulus: 7685655455... public exponent: 65537) |
sha_1 | string | SHA1 of certificate. (example: c8de1d13vtu435ilj435lj345796d8jh7hk8hgk) (wire: sha1) |
sha_256 | string | SHA256 of certificate. (example: 5vt6rt6jtr654eef94ec3f91122a623b389f4d331ff330026e43af21013vb45f) (wire: sha256) |
type | string | Type of the certificate. (example: TLS) |
validated_by | string | The unique identified for the user who has approved the certificate. (example: user_id) |
validated_date | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | destination_id, hash | Returns details of the certificate approved for the specified destination with specified certificate hash. | |
list | select | destination_id | cursor, limit | Returns the list of approved certificates for the specified destination. |
create | insert | destination_id, encoded_cert, hash | 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 /> | |
delete | delete | destination_id, hash | Revokes 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.
| Name | Datatype | Description |
|---|---|---|
destination_id | string | The unique identifier for the destination within the Fivetran system. |
hash | string | The unique identifier of the certificate (Base64URL encoded hash of the certificate). |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
SELECT examples
- get
- list
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
;
Returns the list of approved certificates for the specified destination.
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 "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: destination_certificates
props:
- name: destination_id
value: "{{ destination_id }}"
description: Required parameter for the destination_certificates resource.
- name: hash
value: "{{ hash }}"
description: |
Hash of the certificate.
- name: encoded_cert
value: "{{ encoded_cert }}"
description: |
The certificate encoded in base64.
DELETE examples
- delete
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
;