CDN distribution: add string validator for backend type (#798)

* CDN distribution: add string validator for backend type

* Update stackit/internal/services/cdn/distribution/resource.go

Co-authored-by: Rüdiger Schmitz <ruediger.schmitz@inovex.de>

* fix suggestion apply

---------

Co-authored-by: Malte Ehrlen <malte.ehrlen@freiheit.com>
Co-authored-by: Rüdiger Schmitz <ruediger.schmitz@inovex.de>
This commit is contained in:
Malte Ehrlen 2025-04-30 14:33:25 +03:00 committed by GitHub
parent 30a01c3037
commit 89fa6e5777
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View file

@ -73,6 +73,7 @@ func (r *distributionDataSource) Metadata(_ context.Context, req datasource.Meta
}
func (r *distributionDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
backendOptions := []string{"http"}
resp.Schema = schema.Schema{
MarkdownDescription: features.AddBetaDescription("CDN distribution data source schema."),
Description: "CDN distribution data source schema.",
@ -147,7 +148,7 @@ func (r *distributionDataSource) Schema(_ context.Context, _ datasource.SchemaRe
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
Computed: true,
Description: schemaDescriptions["config_backend_type"],
Description: schemaDescriptions["config_backend_type"] + utils.SupportedValuesDocumentation(backendOptions),
},
"origin_url": schema.StringAttribute{
Computed: true,