diff --git a/docs/data-sources/cdn_distribution.md b/docs/data-sources/cdn_distribution.md
index 58993f93..4c8618e4 100644
--- a/docs/data-sources/cdn_distribution.md
+++ b/docs/data-sources/cdn_distribution.md
@@ -61,7 +61,7 @@ Read-Only:
- `geofencing` (Map of List of String) A map of URLs to a list of countries where content is allowed.
- `origin_request_headers` (Map of String) The configured origin request headers for the backend
- `origin_url` (String) The configured backend type for the distribution
-- `type` (String) The configured backend type. Supported values are: `http`.
+- `type` (String) The configured backend type. Possible values are: `http`.
diff --git a/docs/data-sources/network_interface.md b/docs/data-sources/network_interface.md
index 14c0566f..d6570aea 100644
--- a/docs/data-sources/network_interface.md
+++ b/docs/data-sources/network_interface.md
@@ -40,4 +40,4 @@ data "stackit_network_interface" "example" {
- `name` (String) The name of the network interface.
- `security` (Boolean) The Network Interface Security. If set to false, then no security groups will apply to this network interface.
- `security_group_ids` (List of String) The list of security group UUIDs. If security is set to false, setting this field will lead to an error.
-- `type` (String) Type of network interface. Some of the possible values are: Supported values are: `server`, `metadata`, `gateway`.
+- `type` (String) Type of network interface. Some of the possible values are: Possible values are: `server`, `metadata`, `gateway`.
diff --git a/docs/data-sources/security_group_rule.md b/docs/data-sources/security_group_rule.md
index 124f0bfe..749504de 100644
--- a/docs/data-sources/security_group_rule.md
+++ b/docs/data-sources/security_group_rule.md
@@ -32,7 +32,7 @@ data "stackit_security_group_rule" "example" {
### Read-Only
- `description` (String) The description of the security group rule.
-- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Supported values are: `ingress`, `egress`.
+- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Possible values are: `ingress`, `egress`.
- `ether_type` (String) The ethertype which the rule should match.
- `icmp_parameters` (Attributes) ICMP Parameters. (see [below for nested schema](#nestedatt--icmp_parameters))
- `id` (String) Terraform's internal datasource ID. It is structured as "`project_id`,`security_group_id`,`security_group_rule_id`".
diff --git a/docs/data-sources/volume.md b/docs/data-sources/volume.md
index 26d554d9..b45c1993 100644
--- a/docs/data-sources/volume.md
+++ b/docs/data-sources/volume.md
@@ -45,4 +45,4 @@ data "stackit_volume" "example" {
Read-Only:
- `id` (String) The ID of the source, e.g. image ID
-- `type` (String) The type of the source. Supported values are: `volume`, `image`, `snapshot`, `backup`.
+- `type` (String) The type of the source. Possible values are: `volume`, `image`, `snapshot`, `backup`.
diff --git a/docs/resources/cdn_distribution.md b/docs/resources/cdn_distribution.md
index 0a2c9b16..66338f0c 100644
--- a/docs/resources/cdn_distribution.md
+++ b/docs/resources/cdn_distribution.md
@@ -79,7 +79,7 @@ Optional:
Required:
- `origin_url` (String) The configured backend type for the distribution
-- `type` (String) The configured backend type. Supported values are: `http`.
+- `type` (String) The configured backend type. Possible values are: `http`.
Optional:
diff --git a/docs/resources/dns_zone.md b/docs/resources/dns_zone.md
index e8b31e93..25bc0ae8 100644
--- a/docs/resources/dns_zone.md
+++ b/docs/resources/dns_zone.md
@@ -53,7 +53,7 @@ import {
- `primaries` (List of String) Primary name server for secondary zone. E.g. ["1.2.3.4"]
- `refresh_time` (Number) Refresh time. E.g. 3600
- `retry_time` (Number) Retry time. E.g. 600
-- `type` (String) Zone type. Defaults to `primary`. Supported values are: `primary`, `secondary`.
+- `type` (String) Zone type. Defaults to `primary`. Possible values are: `primary`, `secondary`.
### Read-Only
diff --git a/docs/resources/loadbalancer.md b/docs/resources/loadbalancer.md
index a92b9675..2d527baf 100644
--- a/docs/resources/loadbalancer.md
+++ b/docs/resources/loadbalancer.md
@@ -254,7 +254,7 @@ import {
Required:
- `port` (Number) Port number where we listen for traffic.
-- `protocol` (String) Protocol is the highest network protocol we understand to load balance. Supported values are: `PROTOCOL_UNSPECIFIED`, `PROTOCOL_TCP`, `PROTOCOL_UDP`, `PROTOCOL_TCP_PROXY`, `PROTOCOL_TLS_PASSTHROUGH`.
+- `protocol` (String) Protocol is the highest network protocol we understand to load balance. Possible values are: `PROTOCOL_UNSPECIFIED`, `PROTOCOL_TCP`, `PROTOCOL_UDP`, `PROTOCOL_TCP_PROXY`, `PROTOCOL_TLS_PASSTHROUGH`.
- `target_pool` (String) Reference target pool by target pool name.
Optional:
@@ -295,7 +295,7 @@ Optional:
Required:
- `network_id` (String) Openstack network ID.
-- `role` (String) The role defines how the load balancer is using the network. Supported values are: `ROLE_UNSPECIFIED`, `ROLE_LISTENERS_AND_TARGETS`, `ROLE_LISTENERS`, `ROLE_TARGETS`.
+- `role` (String) The role defines how the load balancer is using the network. Possible values are: `ROLE_UNSPECIFIED`, `ROLE_LISTENERS_AND_TARGETS`, `ROLE_LISTENERS`, `ROLE_TARGETS`.
diff --git a/docs/resources/mongodbflex_instance.md b/docs/resources/mongodbflex_instance.md
index 27ab7a04..5d65acfe 100644
--- a/docs/resources/mongodbflex_instance.md
+++ b/docs/resources/mongodbflex_instance.md
@@ -86,7 +86,7 @@ Read-Only:
Required:
- `point_in_time_window_hours` (Number) The number of hours back in time the point-in-time recovery feature will be able to recover.
-- `type` (String) Type of the MongoDB Flex instance. Supported values are: `Replica`, `Sharded`, `Single`.
+- `type` (String) Type of the MongoDB Flex instance. Possible values are: `Replica`, `Sharded`, `Single`.
Optional:
diff --git a/docs/resources/network_interface.md b/docs/resources/network_interface.md
index 7d01c9d3..4ef8a871 100644
--- a/docs/resources/network_interface.md
+++ b/docs/resources/network_interface.md
@@ -50,4 +50,4 @@ import {
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`network_id`,`network_interface_id`".
- `mac` (String) The MAC address of network interface.
- `network_interface_id` (String) The network interface ID.
-- `type` (String) Type of network interface. Some of the possible values are: Supported values are: `server`, `metadata`, `gateway`.
+- `type` (String) Type of network interface. Some of the possible values are: Possible values are: `server`, `metadata`, `gateway`.
diff --git a/docs/resources/postgresflex_user.md b/docs/resources/postgresflex_user.md
index 1e136013..763e1e19 100644
--- a/docs/resources/postgresflex_user.md
+++ b/docs/resources/postgresflex_user.md
@@ -34,7 +34,7 @@ import {
- `instance_id` (String) ID of the PostgresFlex instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.
-- `roles` (Set of String) Database access levels for the user. Supported values are: `login`, `createdb`.
+- `roles` (Set of String) Database access levels for the user. Possible values are: `login`, `createdb`.
- `username` (String)
### Optional
diff --git a/docs/resources/security_group_rule.md b/docs/resources/security_group_rule.md
index 0b20ca84..452f7c94 100644
--- a/docs/resources/security_group_rule.md
+++ b/docs/resources/security_group_rule.md
@@ -40,7 +40,7 @@ import {
### Required
-- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Supported values are: `ingress`, `egress`.
+- `direction` (String) The direction of the traffic which the rule should match. Some of the possible values are: Possible values are: `ingress`, `egress`.
- `project_id` (String) STACKIT project ID to which the security group rule is associated.
- `security_group_id` (String) The security group ID.
diff --git a/docs/resources/server.md b/docs/resources/server.md
index 13486682..6cb003c9 100644
--- a/docs/resources/server.md
+++ b/docs/resources/server.md
@@ -406,7 +406,7 @@ import {
- `affinity_group` (String) The affinity group the server is assigned to.
- `availability_zone` (String) The availability zone of the server.
- `boot_volume` (Attributes) The boot volume for the server (see [below for nested schema](#nestedatt--boot_volume))
-- `desired_status` (String) The desired status of the server resource. Supported values are: `active`, `inactive`, `deallocated`.
+- `desired_status` (String) The desired status of the server resource. Possible values are: `active`, `inactive`, `deallocated`.
- `image_id` (String) The image ID to be used for an ephemeral disk on the server.
- `keypair_name` (String) The name of the keypair used during server creation.
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container
@@ -427,7 +427,7 @@ import {
Required:
- `source_id` (String) The ID of the source, either image ID or volume ID
-- `source_type` (String) The type of the source. Supported values are: `volume`, `image`.
+- `source_type` (String) The type of the source. Possible values are: `volume`, `image`.
Optional:
diff --git a/docs/resources/volume.md b/docs/resources/volume.md
index be2b3cdf..8ffb571b 100644
--- a/docs/resources/volume.md
+++ b/docs/resources/volume.md
@@ -59,4 +59,4 @@ import {
Required:
- `id` (String) The ID of the source, e.g. image ID
-- `type` (String) The type of the source. Supported values are: `volume`, `image`, `snapshot`, `backup`.
+- `type` (String) The type of the source. Possible values are: `volume`, `image`, `snapshot`, `backup`.
diff --git a/stackit/internal/services/cdn/distribution/datasource.go b/stackit/internal/services/cdn/distribution/datasource.go
index c111fcc9..0f1b085b 100644
--- a/stackit/internal/services/cdn/distribution/datasource.go
+++ b/stackit/internal/services/cdn/distribution/datasource.go
@@ -131,7 +131,7 @@ func (r *distributionDataSource) Schema(_ context.Context, _ datasource.SchemaRe
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
Computed: true,
- Description: schemaDescriptions["config_backend_type"] + utils.SupportedValuesDocumentation(backendOptions),
+ Description: schemaDescriptions["config_backend_type"] + utils.FormatPossibleValues(backendOptions...),
},
"origin_url": schema.StringAttribute{
Computed: true,
diff --git a/stackit/internal/services/cdn/distribution/resource.go b/stackit/internal/services/cdn/distribution/resource.go
index a9d03cef..2cfdd114 100644
--- a/stackit/internal/services/cdn/distribution/resource.go
+++ b/stackit/internal/services/cdn/distribution/resource.go
@@ -250,7 +250,7 @@ func (r *distributionResource) Schema(_ context.Context, _ resource.SchemaReques
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
Required: true,
- Description: schemaDescriptions["config_backend_type"] + utils.SupportedValuesDocumentation(backendOptions),
+ Description: schemaDescriptions["config_backend_type"] + utils.FormatPossibleValues(backendOptions...),
Validators: []validator.String{stringvalidator.OneOf(backendOptions...)},
},
"origin_url": schema.StringAttribute{
diff --git a/stackit/internal/services/dns/zone/resource.go b/stackit/internal/services/dns/zone/resource.go
index 4b05814c..cfddeafe 100644
--- a/stackit/internal/services/dns/zone/resource.go
+++ b/stackit/internal/services/dns/zone/resource.go
@@ -235,7 +235,7 @@ func (r *zoneResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
},
},
"type": schema.StringAttribute{
- Description: "Zone type. Defaults to `primary`. " + utils.SupportedValuesDocumentation(primaryOptions),
+ Description: "Zone type. Defaults to `primary`. " + utils.FormatPossibleValues(primaryOptions...),
Optional: true,
Computed: true,
Default: stringdefault.StaticString("primary"),
diff --git a/stackit/internal/services/iaas/networkinterface/datasource.go b/stackit/internal/services/iaas/networkinterface/datasource.go
index dd0e3812..710cac52 100644
--- a/stackit/internal/services/iaas/networkinterface/datasource.go
+++ b/stackit/internal/services/iaas/networkinterface/datasource.go
@@ -126,7 +126,7 @@ func (d *networkInterfaceDataSource) Schema(_ context.Context, _ datasource.Sche
ElementType: types.StringType,
},
"type": schema.StringAttribute{
- Description: "Type of network interface. Some of the possible values are: " + utils.SupportedValuesDocumentation(typeOptions),
+ Description: "Type of network interface. Some of the possible values are: " + utils.FormatPossibleValues(typeOptions...),
Computed: true,
},
},
diff --git a/stackit/internal/services/iaas/networkinterface/resource.go b/stackit/internal/services/iaas/networkinterface/resource.go
index 1532a9b8..d84d1a93 100644
--- a/stackit/internal/services/iaas/networkinterface/resource.go
+++ b/stackit/internal/services/iaas/networkinterface/resource.go
@@ -237,7 +237,7 @@ func (r *networkInterfaceResource) Schema(_ context.Context, _ resource.SchemaRe
},
},
"type": schema.StringAttribute{
- Description: "Type of network interface. Some of the possible values are: " + utils.SupportedValuesDocumentation(typeOptions),
+ Description: "Type of network interface. Some of the possible values are: " + utils.FormatPossibleValues(typeOptions...),
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
diff --git a/stackit/internal/services/iaas/securitygrouprule/datasource.go b/stackit/internal/services/iaas/securitygrouprule/datasource.go
index 77d38521..c286fcc4 100644
--- a/stackit/internal/services/iaas/securitygrouprule/datasource.go
+++ b/stackit/internal/services/iaas/securitygrouprule/datasource.go
@@ -90,7 +90,7 @@ func (r *securityGroupRuleDataSource) Schema(_ context.Context, _ datasource.Sch
},
},
"direction": schema.StringAttribute{
- Description: "The direction of the traffic which the rule should match. Some of the possible values are: " + utils.SupportedValuesDocumentation(directionOptions),
+ Description: "The direction of the traffic which the rule should match. Some of the possible values are: " + utils.FormatPossibleValues(directionOptions...),
Computed: true,
},
"description": schema.StringAttribute{
diff --git a/stackit/internal/services/iaas/securitygrouprule/resource.go b/stackit/internal/services/iaas/securitygrouprule/resource.go
index 735e88cc..00b24a5c 100644
--- a/stackit/internal/services/iaas/securitygrouprule/resource.go
+++ b/stackit/internal/services/iaas/securitygrouprule/resource.go
@@ -230,7 +230,7 @@ func (r *securityGroupRuleResource) Schema(_ context.Context, _ resource.SchemaR
},
},
"direction": schema.StringAttribute{
- Description: "The direction of the traffic which the rule should match. Some of the possible values are: " + utils.SupportedValuesDocumentation(directionOptions),
+ Description: "The direction of the traffic which the rule should match. Some of the possible values are: " + utils.FormatPossibleValues(directionOptions...),
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
diff --git a/stackit/internal/services/iaas/server/resource.go b/stackit/internal/services/iaas/server/resource.go
index 5701d9ca..a3256119 100644
--- a/stackit/internal/services/iaas/server/resource.go
+++ b/stackit/internal/services/iaas/server/resource.go
@@ -262,7 +262,7 @@ func (r *serverResource) Schema(_ context.Context, _ resource.SchemaRequest, res
},
},
"source_type": schema.StringAttribute{
- Description: "The type of the source. " + utils.SupportedValuesDocumentation(supportedSourceTypes),
+ Description: "The type of the source. " + utils.FormatPossibleValues(supportedSourceTypes...),
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
@@ -366,7 +366,7 @@ func (r *serverResource) Schema(_ context.Context, _ resource.SchemaRequest, res
Computed: true,
},
"desired_status": schema.StringAttribute{
- Description: "The desired status of the server resource. " + utils.SupportedValuesDocumentation(desiredStatusOptions),
+ Description: "The desired status of the server resource. " + utils.FormatPossibleValues(desiredStatusOptions...),
Optional: true,
Validators: []validator.String{
stringvalidator.OneOf(desiredStatusOptions...),
diff --git a/stackit/internal/services/iaas/volume/datasource.go b/stackit/internal/services/iaas/volume/datasource.go
index 66477200..ff89d273 100644
--- a/stackit/internal/services/iaas/volume/datasource.go
+++ b/stackit/internal/services/iaas/volume/datasource.go
@@ -118,7 +118,7 @@ func (r *volumeDataSource) Schema(_ context.Context, _ datasource.SchemaRequest,
Computed: true,
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
- Description: "The type of the source. " + utils.SupportedValuesDocumentation(SupportedSourceTypes),
+ Description: "The type of the source. " + utils.FormatPossibleValues(SupportedSourceTypes...),
Computed: true,
},
"id": schema.StringAttribute{
diff --git a/stackit/internal/services/iaas/volume/resource.go b/stackit/internal/services/iaas/volume/resource.go
index 2b409a17..8f6bd16b 100644
--- a/stackit/internal/services/iaas/volume/resource.go
+++ b/stackit/internal/services/iaas/volume/resource.go
@@ -225,7 +225,7 @@ func (r *volumeResource) Schema(_ context.Context, _ resource.SchemaRequest, res
},
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
- Description: "The type of the source. " + utils.SupportedValuesDocumentation(SupportedSourceTypes),
+ Description: "The type of the source. " + utils.FormatPossibleValues(SupportedSourceTypes...),
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
diff --git a/stackit/internal/services/loadbalancer/loadbalancer/resource.go b/stackit/internal/services/loadbalancer/loadbalancer/resource.go
index e6aa031f..e7f38248 100644
--- a/stackit/internal/services/loadbalancer/loadbalancer/resource.go
+++ b/stackit/internal/services/loadbalancer/loadbalancer/resource.go
@@ -330,13 +330,13 @@ func (r *loadBalancerResource) Schema(_ context.Context, _ resource.SchemaReques
"disable_security_group_assignment": "If set to true, this will disable the automatic assignment of a security group to the load balancer's targets. This option is primarily used to allow targets that are not within the load balancer's own network or SNA (STACKIT network area). When this is enabled, you are fully responsible for ensuring network connectivity to the targets, including managing all routing and security group rules manually. This setting cannot be changed after the load balancer is created.",
"listeners": "List of all listeners which will accept traffic. Limited to 20.",
"port": "Port number where we listen for traffic.",
- "protocol": "Protocol is the highest network protocol we understand to load balance. " + utils.SupportedValuesDocumentation(protocolOptions),
+ "protocol": "Protocol is the highest network protocol we understand to load balance. " + utils.FormatPossibleValues(protocolOptions...),
"target_pool": "Reference target pool by target pool name.",
"name": "Load balancer name.",
"plan_id": "The service plan ID. If not defined, the default service plan is `p10`. " + utils.FormatPossibleValues(servicePlanOptions...),
"networks": "List of networks that listeners and targets reside in.",
"network_id": "Openstack network ID.",
- "role": "The role defines how the load balancer is using the network. " + utils.SupportedValuesDocumentation(roleOptions),
+ "role": "The role defines how the load balancer is using the network. " + utils.FormatPossibleValues(roleOptions...),
"observability": "We offer Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation.",
"observability_logs": "Observability logs configuration. Not changeable after creation.",
"observability_logs_credentials_ref": "Credentials reference for logs. Not changeable after creation.",
diff --git a/stackit/internal/services/mongodbflex/instance/resource.go b/stackit/internal/services/mongodbflex/instance/resource.go
index a4330fd8..e3b4d226 100644
--- a/stackit/internal/services/mongodbflex/instance/resource.go
+++ b/stackit/internal/services/mongodbflex/instance/resource.go
@@ -180,7 +180,7 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
"acl": "The Access Control List (ACL) for the MongoDB Flex instance.",
"backup_schedule": `The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *").`,
"options": "Custom parameters for the MongoDB Flex instance.",
- "type": fmt.Sprintf("Type of the MongoDB Flex instance. %s", utils.SupportedValuesDocumentation(typeOptions)),
+ "type": fmt.Sprintf("Type of the MongoDB Flex instance. %s", utils.FormatPossibleValues(typeOptions...)),
"snapshot_retention_days": "The number of days that continuous backups (controlled via the `backup_schedule`) will be retained.",
"daily_snapshot_retention_days": "The number of days that daily backups will be retained.",
"weekly_snapshot_retention_weeks": "The number of weeks that weekly backups will be retained.",
diff --git a/stackit/internal/services/postgresflex/user/resource.go b/stackit/internal/services/postgresflex/user/resource.go
index be364871..a67966ca 100644
--- a/stackit/internal/services/postgresflex/user/resource.go
+++ b/stackit/internal/services/postgresflex/user/resource.go
@@ -123,7 +123,7 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
"user_id": "User ID.",
"instance_id": "ID of the PostgresFlex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
- "roles": "Database access levels for the user. " + utils.SupportedValuesDocumentation(rolesOptions),
+ "roles": "Database access levels for the user. " + utils.FormatPossibleValues(rolesOptions...),
"region": "The resource region. If not defined, the provider region is used.",
}
diff --git a/stackit/internal/utils/utils.go b/stackit/internal/utils/utils.go
index 5190660f..a7614113 100644
--- a/stackit/internal/utils/utils.go
+++ b/stackit/internal/utils/utils.go
@@ -110,20 +110,6 @@ func ConvertPointerSliceToStringSlice(pointerSlice []*string) []string {
}
return stringSlice
}
-func SupportedValuesDocumentation(values []string) string {
- if len(values) == 0 {
- return ""
- }
- return "Supported values are: " + strings.Join(QuoteValues(values), ", ") + "."
-}
-
-func QuoteValues(values []string) []string {
- quotedValues := make([]string, len(values))
- for i, value := range values {
- quotedValues[i] = fmt.Sprintf("`%s`", value)
- }
- return quotedValues
-}
func IsLegacyProjectRole(role string) bool {
return utils.Contains(LegacyProjectRoles, role)
diff --git a/stackit/internal/utils/utils_test.go b/stackit/internal/utils/utils_test.go
index 8d6851aa..0dc5bf5b 100644
--- a/stackit/internal/utils/utils_test.go
+++ b/stackit/internal/utils/utils_test.go
@@ -253,39 +253,6 @@ func TestSimplifyBackupSchedule(t *testing.T) {
}
}
-func TestSupportedValuesDocumentation(t *testing.T) {
- tests := []struct {
- description string
- values []string
- expected string
- }{
- {
- "empty values",
- []string{},
- "",
- },
- {
- "single value",
- []string{"value"},
- "Supported values are: `value`.",
- },
- {
- "multiple values",
- []string{"value1", "value2", "value3"},
- "Supported values are: `value1`, `value2`, `value3`.",
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.description, func(t *testing.T) {
- output := SupportedValuesDocumentation(tt.values)
- if output != tt.expected {
- t.Fatalf("Data does not match: %s", output)
- }
- })
- }
-}
-
func TestIsLegacyProjectRole(t *testing.T) {
tests := []struct {
description string