Understanding the configurations
Terraform configuration files such as main.tf
, variable.tf
, output.tf
, and terraform.auto.tfvars
are provided as examples to quickly start using the Sectigo Terraform provider.
Terraform, provider and resource blocks
The configuration file main.tf
provides examples of terraform, provider, and resource blocks.
"terraform {
required_providers {
sectigo = {
source = ""<my_domain>/<my_namaspace>/sectigo""
version = "">= 2.x.x""
}
}
}"
provider "sectigo" {
username = var.SECTIGO_CM_LOGIN
password = var.SECTIGO_CM_PWD
customer_uri = var.SECTIGO_CM_CUSTOMERURI
}
resource "sectigo_certificate" "ssl_certificate" {
base_url = var.sectigo_ssl_cert_cm_base_url
orgid = var.sectigo_cm_org_id
cert_file_path = var.sectigo_ssl_cert_file_path
cert_file_name = var.sectigo_ssl_cert_file_name
cert_type = var.sectigo_ssl_cert_type
cert_config_type = var.sectigo_ssl_cert_config_type
cert_validity = var.sectigo_ssl_cert_validity
# ...and so on.
}
Configuration reference
The following attributes are contained in the provider block and provide the credentials for connecting to SCM.
Argument | Environment Variable | Type | Description |
---|---|---|---|
|
|
Mandatory |
The user’s Sectigo username |
|
|
Conditional |
The user’s Sectigo password. Required for password authentication to SCM. |
|
|
Mandatory |
The user’s Sectigo URL |
|
|
Conditional |
Authentication type to use.
Defaults to Required for client certificate authentication with value |
|
|
Conditional |
Client certificate to use for authentication. Required for client certificate authentication. |
|
|
Conditional |
Private key associated with client certificate. Required for client certificate authentication. |
Argument reference
The following attributes are contained in the resource block and provide certificate management.
Argument | Type | Description |
---|---|---|
|
Mandatory |
Automatically renew certificate if within renewal period. |
|
Mandatory |
The base URL of the Sectigo Certificate Manager.
Path is similar to |
|
Optional |
Certificate comments for enrollment |
|
Mandatory |
Certificate configuration type.
Either |
|
Optional |
External requester containing a list of email addresses |
|
Mandatory |
SSL certificate file name to save the certificate, CSR and private keys. Required for SSL/TLS certificates. |
|
Conditional |
SSL certificate file path to save certificate files into. Required for SSL/TLS certificates. |
|
Conditional |
Certificate format type to be downloaded. Required for SSL certificates. |
|
Optional |
Number of server licenses |
|
Mandatory |
Certificate type ID for management |
|
Mandatory |
Certificate validity period |
|
Conditional |
Certificate warning days used for certificate if the |
|
Optional |
Custom fields applied to requested certificate |
|
Conditional |
Client certificate email address for the user |
|
Conditional |
Client certificate file name to save the certificate, CSR and private keys. Required for S/MIME certificates. |
|
Conditional |
Client certificate file path to save certificates files into. Required for S/MIME certificates. |
|
Conditional |
Client certificate user’s first name. Required for S/MIME certificates. |
|
Conditional |
Client certificate user’s last name. Required for S/MIME certificates. |
|
Optional |
Client certificate user’s middle name |
|
Optional |
Client certificate revoke on replace |
|
Conditional |
Country field for generated CSR. Required if |
|
Conditional |
Signing algorithm curve length. Required if |
|
Conditional |
Domain name in the certificate Common Name(CN) field. Required if |
|
Conditional |
Certificate email address in the emailAddress field. Required if |
|
Conditional |
CSR provided by user. Require if CSR is being provided and not generated. |
|
Conditional |
Location field for the generated CSR. Required if |
|
Mandatory |
Looping period to check for certificate download |
|
Mandatory |
Maximum timeout for certificate download |
|
Conditional |
Organizational unit for the generated CSR. Required if |
|
Conditional |
Organization for the generated CSR. Required if |
|
Mandatory |
Sectigo CM organization identifier |
|
Conditional |
Province or state for the generated CSR. Required if |
|
Conditional |
Reason for replace or revocation of certificate. Required for replace and revoke. |
|
Conditional |
Signature algorithm bit size. Required if |
|
Optional |
Server type ID |
|
Conditional |
Signature algorithm either Required if |
|
Optional |
Customer fields to be applied to generated CSR |
|
Optional |
Subject alternate names to be applied to generated CSR |
Variable configuration
The variables.tf
provides a mapping of variables and the attributes described in the Argument reference.
The next section describes the variables defined in variables.tf
and assigned in terraform.auto.tfvars
.
The example main.tf
maps the arguments to these variables.
Credentials and connection parameters
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
The user’s Sectigo username |
|
|
Conditional |
The user’s Sectigo password. Not required for client certificate authentication. |
|
|
Mandatory |
The user’s Sectigo URL |
|
|
Conditional |
The authentication type to use with SCM.
Either Required for |
|
|
Conditional |
The client certificate in PEM format if authentication type is |
|
|
Conditional |
The private key associated with the client certificate if authentication type is |
Establishing a connection with SCM requires the URL and organization identifier. The following table shows the connection arguments to these variables.
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
The customer’s organization ID |
|
|
Mandatory |
The base URL of the Sectigo Certificate Manager (SSL).
Path is similar to |
|
|
Mandatory |
The base URL of the Sectigo Certificate Manager (client).
Path is similar to |
CSR parameters
The following parameters are required during the generation of the certificate signing request (CSR).
Conditional variables are required if sectigo_csr
is not provided.
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Conditional |
A single value for a domain which is included in the certificate Common Name (CN) field |
|
|
Conditional |
The country name which is included in the certificate Country (C) field |
|
|
Conditional |
The state/province name which is included in the certificate State (ST) field. |
|
|
Conditional |
The location name which is included in the certificate Location (L) field. |
|
|
Conditional |
The organization name which is included in the certificate Organization (O) field. |
|
|
Conditional |
The organization unit which is included in the certificate Organization Unit (OU) field. |
|
|
Conditional |
The email address which is included in the certificate emailAddress field. |
|
|
Conditional |
The private key algorithm used to generate the private key.
The default value is |
|
|
Conditional |
The size of the SSL/TLS key to generate. The possible values are:
|
|
|
Conditional |
The location where the existing |
Certificate issuance parameters
The following parameters are used for certificate issuance. The table is separated into SSL certificates and client certificates variables. Auto-renewal manages certificate expiration and renewal configuration.
SSL Certificates
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
The location where the certificate is to be stored. The same location is used to store the CSR and private key. |
|
|
Mandatory |
The name of the SSL certificate file. The same name is used for the CSR and private key. |
|
|
Mandatory |
The type of the SSL certificate. This is the ID of the SSL certificate type. |
|
|
Mandatory |
The type of certificate.
Its value should be |
|
|
Mandatory |
The certificate validity period in days.
The values are constrained by the choice of |
|
|
Optional |
The format type for the SSL certificate. The supported values are:
|
|
|
Optional |
Comments for certificate enrollment |
|
|
Optional |
A single or comma-separated list of email(s) |
|
|
Optional |
A single or comma-separated list of subject alternate names (SAN) |
|
|
Conditional |
The number of server licenses |
|
|
Optional |
The server type ID |
|
|
Optional |
The custom fields to be applied to the requested certificate. The expected format for custom fields is the following.
If you are providing this input in a JSON string, make sure that the internal double quotes are escaped properly using |
Client Certificates
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
The location where the certificate is to be stored. The same location is used to store the CSR and private key. |
|
|
Mandatory |
The name of the client certificate file. The same name is used for the CSR and private key. |
|
|
Mandatory |
The type of the client certificate. This is the ID of the client certificate type. |
|
|
Mandatory |
The type of certificate.
Its value should be |
|
|
Mandatory |
The certificate validity period in days.
The values are constrained by the choice of |
|
|
Mandatory |
The email address of the user |
|
|
Mandatory |
The first name of the user which is registered with Sectigo |
|
|
Optional |
The middle name of the user |
|
|
Mandatory |
The last name of the user |
|
|
Optional |
The custom fields to be applied to the requested certificate. The expected format for custom fields is the following.
If you are providing this input in a JSON string, make sure that the internal double quotes are escaped properly using |
|
|
Optional |
A Boolean value to determine if revocation on replacement is required. |
Auto-renewal
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
Renew the certificate automatically after certificate expired.
The default value is |
|
|
Conditional |
The number of days prior to expiration that a new certificate enrollment process will be initiated if the |
Certificate collection parameters
Certificate collection may fail if the certificate is still being processed. In such cases, the Sectigo Terraform Integration will try several times before returning a failure. The following parameters are used to configure the frequency and maximum time for additional attempts at certificate collection.
Variable | Argument | Type | Description |
---|---|---|---|
|
|
Mandatory |
The time (in seconds) before an attempt to download the certificate will timeout.
The default value is |
|
|
Mandatory |
The time (in seconds) between each attempt to download a certificate.
The default value is |