Certificates resources
Azion Terraform Provider resource and data sources that create and read digital certificates: azion_digital_certificate and azion_digital_certificates.
A digital certificate is the SSL/TLS certificate and private key pair that lets an application answer over HTTPS. The Azion Terraform Provider manages the certificates of Certificate Manager with one resource and reads them with two data sources.
Certificate resources
| Resource | Description |
|---|---|
azion_digital_certificate | Creates and manages a digital certificate. |
azion_digital_certificate requires three string arguments: name, the name of the certificate; certificate, the SSL/TLS certificate in PEM format; and private_key, the private key in PEM format. It exports id, a string that holds the unique ID of the certificate. The Terraform Registry page of the resource lists every argument.
Data sources
| Data source | Description |
|---|---|
azion_digital_certificates | Lists digital certificates. |
azion_digital_certificate | Reads one digital certificate. |
Example
This configuration pins the provider, creates a certificate from a certificate file and a private key file in the certificates folder of the module, reads the existing certificates, and outputs the ID of the certificate. It reads your personal token from the api_token variable that the Azion Terraform Provider quickstart declares.
To keep the certificate and the private key out of the configuration code, declare them as sensitive variables. This block replaces the azion_digital_certificate resource of the configuration above:
A shorter form, with cert.pem and key.pem at the root of the module, is on Resources and data sources.