Skip to content

Commit 7dd76db

Browse files
apply PR suggestions
1 parent 0f6a8b4 commit 7dd76db

10 files changed

Lines changed: 216 additions & 146 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/hashicorp/terraform-plugin-log v0.10.0
1313
github.com/hashicorp/terraform-plugin-testing v1.14.0
1414
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
15-
github.com/stackitcloud/stackit-sdk-go/services/alb v0.7.2
15+
github.com/stackitcloud/stackit-sdk-go/services/alb v0.9.3
1616
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.9.2
1717
github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.6
1818
github.com/stackitcloud/stackit-sdk-go/services/edge v0.4.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnB
151151
github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY=
152152
github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts=
153153
github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
154-
github.com/stackitcloud/stackit-sdk-go/services/alb v0.7.2 h1:x7ndqw6yaOw+TmThNeAkI+eN9vK5hWgjIJlFZrYPREo=
155-
github.com/stackitcloud/stackit-sdk-go/services/alb v0.7.2/go.mod h1:wbPNu6e5r/5xhzznCKbC7fEJahrAOb89gmaIm+0w2/s=
154+
github.com/stackitcloud/stackit-sdk-go/services/alb v0.9.3 h1:X82TZfc6lg8ZoYdckiv5+OsV0d+81Q2TFMJh1TfxGWk=
155+
github.com/stackitcloud/stackit-sdk-go/services/alb v0.9.3/go.mod h1:V6+MolxM/M2FWyWZA+FRFKEzzUe10MU9eEVfMvxHGi8=
156156
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.11.3 h1:JMKEeNQpA+Mb1DRpY3MRQL3pko5JjUWGrevN0xOrx+4=
157157
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.11.3/go.mod h1:uYI9pHAA2g84jJN25ejFUxa0/JtfpPZqMDkctQ1BzJk=
158158
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.9.2 h1:Xp4FxCBiTQhqed2tB26fRJJTQST2NwDTiXiacqeTfMI=

stackit/internal/services/alb/alb_acc_test.go

Lines changed: 108 additions & 21 deletions
Large diffs are not rendered by default.

stackit/internal/services/alb/applicationloadbalancer/datasource.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/http"
77

8+
sdkUtils "github.com/stackitcloud/stackit-sdk-go/core/utils"
89
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
910
albUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/utils"
1011

@@ -56,8 +57,9 @@ func (r *albDataSource) Configure(ctx context.Context, req datasource.ConfigureR
5657

5758
// Schema defines the schema for the resource.
5859
func (r *albDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
59-
protocolOptions := albUtils.ToStringList(albSdk.AllowedListenerProtocolEnumValues)
60-
roleOptions := albUtils.ToStringList(albSdk.AllowedNetworkRoleEnumValues)
60+
protocolOptions := sdkUtils.EnumSliceToStringSlice(albSdk.AllowedListenerProtocolEnumValues)
61+
roleOptions := sdkUtils.EnumSliceToStringSlice(albSdk.AllowedNetworkRoleEnumValues)
62+
errorOptions := sdkUtils.EnumSliceToStringSlice(albSdk.AllowedLoadBalancerErrorTypesEnumValues)
6163

6264
descriptions := map[string]string{
6365
"main": "Application Load Balancer resource schema.",
@@ -66,7 +68,7 @@ func (r *albDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, re
6668
"region": "The resource region. If not defined, the provider region is used.",
6769
"disable_target_security_group_assignment": "Disable target security group assignemt to allow targets outside of the given network. Connectivity to targets need to be ensured by the customer, including routing and Security Groups (targetSecurityGroup can be assigned). Not changeable after creation.",
6870
"errors": "Reports all errors a Application Load Balancer has.",
69-
"errors.type": "Enum: \"TYPE_UNSPECIFIED\" \"TYPE_INTERNAL\" \"TYPE_QUOTA_SECGROUP_EXCEEDED\" \"TYPE_QUOTA_SECGROUPRULE_EXCEEDED\" \"TYPE_PORT_NOT_CONFIGURED\" \"TYPE_FIP_NOT_CONFIGURED\" \"TYPE_TARGET_NOT_ACTIVE\" \"TYPE_METRICS_MISCONFIGURED\" \"TYPE_LOGS_MISCONFIGURED\"\nThe error type specifies which part of the Application Load Balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the Application Load Balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error.",
71+
"errors.type": "Enum: " + utils.FormatPossibleValues(errorOptions...) + "\nThe error type specifies which part of the Application Load Balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the Application Load Balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error.",
7072
"errors.description": "The error description contains additional helpful user information to fix the error state of the Application Load Balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found.",
7173
"external_address": "The external IP address where this Application Load Balancer is exposed. Not changeable after creation.",
7274
"labels": "Labels represent user-defined metadata as key-value pairs. Label count cannot exceed 64 per ALB.",

0 commit comments

Comments
 (0)