ssl_certificates
Creates, updates, deletes, gets or lists a ssl_certificates resource.
Overview
| Name | ssl_certificates |
| Type | Resource |
| Id | netlify.sites.ssl_certificates |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
created_at | string (dateTime) | |
domains | array | |
expires_at | string (dateTime) | |
state | string | |
updated_at | string (dateTime) |
Array of SNI Certificates
| Name | Datatype | Description |
|---|---|---|
created_at | string (dateTime) | |
domains | array | |
expires_at | string (dateTime) | |
state | string | |
updated_at | string (dateTime) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | site_id | ||
list | select | site_id, domain | ||
provision | insert | site_id | certificate, key, ca_certificates | Provisions or updates a TLS certificate for the site.<br /><br />Creating a certificate (site has no certificate):<br />- Omit certificate params to initiate Let's Encrypt provisioning<br />- Provide certificate, key, and ca_certificates to upload a custom certificate<br /><br />Updating a certificate (site already has a certificate):<br />- REQUIRES certificate, key, and ca_certificates to replace with a new custom certificate<br />- Use POST /api/v1/sites/{site_id}/ssl/renew to renew an existing Let's Encrypt certificate |
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 |
|---|---|---|
domain | string | |
site_id | string | |
ca_certificates | string | PEM-encoded CA certificate chain. Required when updating an existing certificate. |
certificate | string | PEM-encoded certificate. Required when updating an existing certificate. |
key | string | PEM-encoded private key. Required when updating an existing certificate. |
SELECT examples
- get
- list
OK
SELECT
created_at,
domains,
expires_at,
state,
updated_at
FROM netlify.sites.ssl_certificates
WHERE site_id = '{{ site_id }}' -- required
;
Array of SNI Certificates
SELECT
created_at,
domains,
expires_at,
state,
updated_at
FROM netlify.sites.ssl_certificates
WHERE site_id = '{{ site_id }}' -- required
AND domain = '{{ domain }}' -- required
;
INSERT examples
- provision
- Manifest
Provisions or updates a TLS certificate for the site.<br /><br />Creating a certificate (site has no certificate):<br />- Omit certificate params to initiate Let's Encrypt provisioning<br />- Provide certificate, key, and ca_certificates to upload a custom certificate<br /><br />Updating a certificate (site already has a certificate):<br />- REQUIRES certificate, key, and ca_certificates to replace with a new custom certificate<br />- Use POST /api/v1/sites/{site_id}/ssl/renew to renew an existing Let's Encrypt certificate
INSERT INTO netlify.sites.ssl_certificates (
site_id,
certificate,
key,
ca_certificates
)
SELECT
'{{ site_id }}',
'{{ certificate }}',
'{{ key }}',
'{{ ca_certificates }}'
RETURNING
created_at,
domains,
expires_at,
state,
updated_at
;
# Description fields are for documentation purposes
- name: ssl_certificates
props:
- name: site_id
value: "{{ site_id }}"
description: Required parameter for the ssl_certificates resource.
- name: certificate
value: "{{ certificate }}"
description: PEM-encoded certificate. Required when updating an existing certificate.
description: PEM-encoded certificate. Required when updating an existing certificate.
- name: key
value: "{{ key }}"
description: PEM-encoded private key. Required when updating an existing certificate.
description: PEM-encoded private key. Required when updating an existing certificate.
- name: ca_certificates
value: "{{ ca_certificates }}"
description: PEM-encoded CA certificate chain. Required when updating an existing certificate.
description: PEM-encoded CA certificate chain. Required when updating an existing certificate.