Skip to main content

certificate_packs

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

Overview

Namecertificate_packs
TypeResource
Idcloudflare.ssl.certificate_packs

Fields

The following fields are returned by SELECT queries:

Get Certificate Pack response

NameDatatypeDescription
idstringIdentifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
certificate_authoritystringCertificate Authority selected for the order. For information on any certificate authority specific details or restrictions see this page for more details. (google, lets_encrypt, ssl_com) (example: lets_encrypt)
certificatesarrayArray of certificates in this pack.
cloudflare_brandingbooleanWhether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.
dcv_delegation_recordsarrayDCV Delegation records for domain validation.
hostsarrayComma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty. (x-stainless-collection-type: set, x-stainless-terraform-configurability: computed_optional)
primary_certificatestringIdentifier of the primary certificate in a pack. (example: 7e7b8deba8538af625850b7b2530034c)
statusstringStatus of certificate pack. (initializing, pending_validation, deleted, pending_issuance, pending_deployment, pending_deletion, pending_expiration, expired, active, initializing_timed_out, validation_timed_out, issuance_timed_out, deployment_timed_out, deletion_timed_out, pending_cleanup, staging_deployment, staging_active, deactivating, inactive, backup_issued, holding_deployment) (example: initializing)
typestringType of certificate pack. (mh_custom, managed_hostname, sni_custom, universal, advanced, total_tls, keyless, legacy_custom) (example: universal)
validation_errorsarrayDomain validation errors that have been received by the certificate authority (CA).
validation_methodstringValidation Method selected for the order. (txt, http, email) (example: txt)
validation_recordsarrayCertificates' validation records.
validity_daysintegerValidity Days selected for the order. (14, 30, 90, 365)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcertificate_pack_id, zone_idFor a given zone, get a certificate pack.
listselectzone_idpage, per_page, status, deployFor a given zone, list all active certificate packs.
createinsertzone_id, type, hosts, validation_method, validity_days, certificate_authorityFor a given zone, order an advanced certificate pack.
editupdatecertificate_pack_id, zone_idFor a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.
deletedeletecertificate_pack_id, zone_idFor a given zone, delete an advanced certificate pack.

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
certificate_pack_idstring
zone_idstringThe Cloudflare zone ID.
deploystring
pagenumber
per_pagenumber
statusstring

SELECT examples

For a given zone, get a certificate pack.

SELECT
id,
certificate_authority,
certificates,
cloudflare_branding,
dcv_delegation_records,
hosts,
primary_certificate,
status,
type,
validation_errors,
validation_method,
validation_records,
validity_days
FROM cloudflare.ssl.certificate_packs
WHERE certificate_pack_id = '{{ certificate_pack_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

INSERT examples

For a given zone, order an advanced certificate pack.

INSERT INTO cloudflare.ssl.certificate_packs (
certificate_authority,
cloudflare_branding,
hosts,
type,
validation_method,
validity_days,
zone_id
)
SELECT
'{{ certificate_authority }}' /* required */,
{{ cloudflare_branding }},
'{{ hosts }}' /* required */,
'{{ type }}' /* required */,
'{{ validation_method }}' /* required */,
{{ validity_days }} /* required */,
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

For a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.

UPDATE cloudflare.ssl.certificate_packs
SET
cloudflare_branding = {{ cloudflare_branding }}
WHERE
certificate_pack_id = '{{ certificate_pack_id }}' --required
AND zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

For a given zone, delete an advanced certificate pack.

DELETE FROM cloudflare.ssl.certificate_packs
WHERE certificate_pack_id = '{{ certificate_pack_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;