Skip to main content
Provider v2 manages Gcore CDN as separate Terraform resources. An origin group holds the source hostnames, and the CDN resource, certificates, rules, and rule templates sit beside it, with delivery behavior in an options map. An API token and provider installation are in the Terraform overview. A v0 configuration moves through the migration guide.

Provider v0 and v2

Provider v2 keeps the same CDN objects and changes how Terraform names them and stores their settings. The account data source is read-only, and its cname attribute is the account CDN hostname. DNS for one resource uses that resource’s id with .gcdn.co appended, which CDN resource prints after apply. Provider 2.0.0-rc.2 adds gcore_cdn_applied_preset and data source gcore_cdn_presets, while provider 2.0.0-rc.1 includes the resources in the table above.

Delivery options

Many option objects contain enabled and value. Setting enabled to false turns that setting off and leaves value in the configuration. Leaving such a key out of options does not change the stored value, and assigning the key null does not clear it either. image_stack carries quality and format fields, fastedge names the apps for each request phase, and other keys add fields beside enabled. http3_enabled uses enabled and value. The provider accepts it only when ssl_enabled is true on the same resource, which HTTPS delivery sets.

Presets

A preset is a read-only bundle of settings for a CDN resource or a rule. Data source gcore_cdn_presets returns each preset id, name, and object_type, which is CDNResource or Rule. gcore_cdn_applied_preset binds preset_id to object_id. While that binding exists, an apply that changes an option the preset owns returns HTTP 400 and names the preset. Removing the gcore_cdn_applied_preset block removes the binding. The next refresh records preset_applied as false and clears the options the preset had written. LIVE STREAMING is the preset for live video, and it owns stale. Video streaming leaves that option unset while the preset is on.