Feature: CDN distribution resource and data source (#786)

* add datasource

* finish data source

* implement resource

* add unit tests

* add examples

* acceptance test

* review comments

* review comments 2

---------

Co-authored-by: Malte Ehrlen <malte.ehrlen@freiheit.com>
This commit is contained in:
Malte Ehrlen 2025-04-29 16:59:07 +03:00 committed by GitHub
parent 3c20b7743f
commit 855d3040ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1520 additions and 0 deletions

View file

@ -51,6 +51,7 @@ var (
TestImageLocalFilePath = getenv("TF_ACC_TEST_IMAGE_LOCAL_FILE_PATH", "default")
ArgusCustomEndpoint = os.Getenv("TF_ACC_ARGUS_CUSTOM_ENDPOINT")
CdnCustomEndpoint = os.Getenv("TF_ACC_CDN_CUSTOM_ENDPOINT")
DnsCustomEndpoint = os.Getenv("TF_ACC_DNS_CUSTOM_ENDPOINT")
IaaSCustomEndpoint = os.Getenv("TF_ACC_IAAS_CUSTOM_ENDPOINT")
LoadBalancerCustomEndpoint = os.Getenv("TF_ACC_LOADBALANCER_CUSTOM_ENDPOINT")
@ -105,6 +106,17 @@ func ObservabilityProviderConfig() string {
ObservabilityCustomEndpoint,
)
}
func CdnProviderConfig() string {
if CdnCustomEndpoint == "" {
return `provider "stackit" {}`
}
return fmt.Sprintf(`
provider "stackit" {
cdn_custom_endpoint = "%s"
}`,
CdnCustomEndpoint,
)
}
func DnsProviderConfig() string {
if DnsCustomEndpoint == "" {