If a CDN resource was created via Terraform, you can add a rule to it via Terraform. To do this, use the following instructions. 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 to create a resource only to identify a resource that should be changed. 3. At this step, you will add the necessary strings for creating a rule to the configuration file. Add the code below to a new string. Replace the hints in the brackets with your values and remove the brackets.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.
- example_rule — the name of the rule for Terraform
- cdn_example_com — the name of the CDN resource in Terraform
- PNG images — the name of the rule from the Gcore Customer Portal
- /folder/images/*.png — the path to the files
- The “WebP Compression” option with a final quality of 66 is required

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.
8. Run the terraform apply command — it will make changes to the CDN. Terraform will ask you to confirm the action — enter “yes”.