The DigitalOcean provider CDN option should support configurations using website.json. The digitalocean_cdn resource in Terraform currently generates a CNAME record with the value as [bucket-name].[region].cdn.digitaloceanspaces.com.
However, to enable automatic serving of index pages (e.g., index.html defined in website.json), instructions state the need to append -static to the region eg.[bucket-name].[region]-static.digitaloceanspaces.com. This however does not appear to work with CDN, which suggests the feature is not fully ready.
Problem Description
The DigitalOcean provider CDN option should support configurations using website.json. The
digitalocean_cdn
resource in Terraform currently generates a CNAME record with the value as[bucket-name].[region].cdn.digitaloceanspaces.com
.However, to enable automatic serving of index pages (e.g., index.html defined in website.json), instructions state the need to append -static to the region eg.
[bucket-name].[region]-static.digitaloceanspaces.com
. This however does not appear to work with CDN, which suggests the feature is not fully ready.Proposed Solutions
A. Expose the CNAME record value:
B. Add a boolean flag to compute the
-static
suffix:C. Allow selection of a pre-existing CNAME record:
Attempted Workaround
Creating the CDN's CNAME record in advance using
digitalocean_record
causesdigitalocean_cdn
to fail with a CNAME conflict error.Additional Context
website.json
to Spaces buckets for automatic index page serving.