If a CDN resource was created via Terraform, you can add an SSL certificate via Terraform. To do this, use the following steps. 1. Open the main.tf file. 2. The file is supposed to contain the code for the creation of your CDN resource. If it is missing, add the code according to the Create a new CDN resource section. Don’t worry, Terraform won’t duplicate a resource. Terraform requires the code used for the creation of the resource only to identify a resource that should be changed. 3. At this step, you will add the necessary strings for issuing an SSL certificate. Add the code below before the following string:Documentation Index
Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
resource "gcore_cdn_resource" "(name of your resource in Terraform)" {. Replace the hints in the brackets with your values and remove the brackets.
- example_cert — the name of the certificate that will be displayed in Terraform,
- example_certificate — the name of the certificate that will be displayed in the Gcore Customer Portal,
- -----BEGIN CERTIFICATE-----MIIDkjCCAnqgAwIBAgIgTfqoZeTGCEvm…T7XH8IlQY0SGq2FSZKJAlrfX+UOpIMWQcOwcuDB97DXl5Bjs+QEXO203GW0C-----END CERTIFICATE----- — the public key of the certificate,
- -----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEAzzj54zBOWxBIJRFMBtG…xyf2T9RZYRpIVbkatg977nXryEZC8Sp8U76c3Oww==-----END RSA PRIVATE KEY----- — the private key of the certificate.

terraform plan command — it will show what changes Terraform is going to make. If the code contains an error, the output will give a brief description of it.
7. Run the terraform apply command — it will make changes to the CDN. Terraform will ask you to confirm the action — enter “yes”.