88 "strings"
99
1010 "github.com/google/uuid"
11+ "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1112 "github.com/hashicorp/terraform-plugin-framework/attr"
1213 "github.com/hashicorp/terraform-plugin-framework/path"
1314 "github.com/hashicorp/terraform-plugin-framework/resource"
@@ -24,6 +25,7 @@ import (
2425 "github.com/stackitcloud/stackit-sdk-go/services/cdn/wait"
2526 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
2627 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
28+ "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
2729 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
2830)
2931
@@ -46,7 +48,7 @@ var schemaDescriptions = map[string]string{
4648 "config" : "The distribution configuration" ,
4749 "config_backend" : "The configured backend for the distribution" ,
4850 "config_regions" : "The configured regions where content will be hosted" ,
49- "config_backend_type" : "The configured backend type" ,
51+ "config_backend_type" : "The configured backend type. " ,
5052 "config_backend_origin_url" : "The configured backend type for the distribution" ,
5153 "config_backend_origin_request_headers" : "The configured origin request headers for the backend" ,
5254 "domain_name" : "The name of the domain" ,
@@ -142,6 +144,7 @@ func (r *distributionResource) Metadata(_ context.Context, req resource.Metadata
142144}
143145
144146func (r * distributionResource ) Schema (_ context.Context , _ resource.SchemaRequest , resp * resource.SchemaResponse ) {
147+ backendOptions := []string {"http" }
145148 resp .Schema = schema.Schema {
146149 MarkdownDescription : features .AddBetaDescription ("CDN distribution data source schema." ),
147150 Description : "CDN distribution data source schema." ,
@@ -218,7 +221,8 @@ func (r *distributionResource) Schema(_ context.Context, _ resource.SchemaReques
218221 Attributes : map [string ]schema.Attribute {
219222 "type" : schema.StringAttribute {
220223 Required : true ,
221- Description : schemaDescriptions ["config_backend_type" ],
224+ Description : schemaDescriptions ["config_backend_type" ] + utils .SupportedValuesDocumentation (backendOptions ),
225+ Validators : []validator.String {stringvalidator .OneOf (backendOptions ... )},
222226 },
223227 "origin_url" : schema.StringAttribute {
224228 Required : true ,
0 commit comments