Skip to main content

certificates

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

Overview

Namecertificates
TypeResource
Iddigitalocean.certificates.certificates

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference a certificate.
namestringA unique human-readable name referring to a certificate.
created_atstringA time value given in ISO8601 combined date and time format that represents when the certificate was created.
dns_namesarrayAn array of fully qualified domain names (FQDNs) for which the certificate was issued.
not_afterstringA time value given in ISO8601 combined date and time format that represents the certificate's expiration date.
sha1_fingerprintstringA unique identifier generated from the SHA-1 fingerprint of the certificate.
statestringA string representing the current state of the certificate. It may be pending, verified, or error.
typestringA string representing the type of the certificate. The value will be custom for a user-uploaded certificate or lets_encrypt for one automatically generated with Let's Encrypt.

Methods

NameAccessible byRequired ParamsDescription
certificates_getSELECTcertificate_idTo show information about an existing certificate, send a GET request to /v2/certificates/$CERTIFICATE_ID.
certificates_listSELECTTo list all of the certificates available on your account, send a GET request to /v2/certificates.
certificates_createINSERTTo upload new SSL certificate which you have previously generated, send a POST request to /v2/certificates. When uploading a user-generated certificate, the private_key, leaf_certificate, and optionally the certificate_chain attributes should be provided. The type must be set to custom. When using Let's Encrypt to create a certificate, the dns_names attribute must be provided, and the type must be set to lets_encrypt.
certificates_deleteDELETEcertificate_idTo delete a specific certificate, send a DELETE request to /v2/certificates/$CERTIFICATE_ID.

SELECT examples

To list all of the certificates available on your account, send a GET request to /v2/certificates.

SELECT
id,
name,
created_at,
dns_names,
not_after,
sha1_fingerprint,
state,
type
FROM digitalocean.certificates.certificates
;

INSERT example

Use the following StackQL query and manifest file to create a new certificates resource.

/*+ create */
INSERT INTO digitalocean.certificates.certificates (
data__name,
data__type,
data__dns_names
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ dns_names }}'
;

DELETE example

Deletes the specified certificates resource.

/*+ delete */
DELETE FROM digitalocean.certificates.certificates
WHERE certificate_id = '{{ certificate_id }}';