Skip to content

Commit 5c8729f

Browse files
authored
feat(Loadbalancer): Min/Max acceptance tests (#796)
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 89fa6e5 commit 5c8729f

5 files changed

Lines changed: 436 additions & 253 deletions

File tree

docs/resources/loadbalancer.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ resource "stackit_loadbalancer" "example" {
119119

120120
### Required
121121

122+
- `external_address` (String) External Load Balancer IP address where this Load Balancer is exposed.
122123
- `listeners` (Attributes List) List of all listeners which will accept traffic. Limited to 20. (see [below for nested schema](#nestedatt--listeners))
123124
- `name` (String) Load balancer name.
124125
- `networks` (Attributes List) List of networks that listeners and targets reside in. (see [below for nested schema](#nestedatt--networks))
@@ -127,7 +128,6 @@ resource "stackit_loadbalancer" "example" {
127128

128129
### Optional
129130

130-
- `external_address` (String) External Load Balancer IP address where this Load Balancer is exposed.
131131
- `options` (Attributes) Defines any optional functionality you want to have enabled on your load balancer. (see [below for nested schema](#nestedatt--options))
132132
- `region` (String) The resource region. If not defined, the provider region is used.
133133

@@ -139,14 +139,17 @@ resource "stackit_loadbalancer" "example" {
139139
<a id="nestedatt--listeners"></a>
140140
### Nested Schema for `listeners`
141141

142-
Optional:
142+
Required:
143143

144-
- `display_name` (String)
145144
- `port` (Number) Port number where we listen for traffic.
146145
- `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`.
147-
- `server_name_indicators` (Attributes List) A list of domain names to match in order to pass TLS traffic to the target pool in the current listener (see [below for nested schema](#nestedatt--listeners--server_name_indicators))
148146
- `target_pool` (String) Reference target pool by target pool name.
149147

148+
Optional:
149+
150+
- `display_name` (String)
151+
- `server_name_indicators` (Attributes List) A list of domain names to match in order to pass TLS traffic to the target pool in the current listener (see [below for nested schema](#nestedatt--listeners--server_name_indicators))
152+
150153
<a id="nestedatt--listeners--server_name_indicators"></a>
151154
### Nested Schema for `listeners.server_name_indicators`
152155

@@ -162,9 +165,6 @@ Optional:
162165
Required:
163166

164167
- `network_id` (String) Openstack network ID.
165-
166-
Optional:
167-
168168
- `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`.
169169

170170

stackit/internal/services/loadbalancer/loadbalancer/resource.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ The example below creates the supporting infrastructure using the STACKIT Terraf
318318
},
319319
"external_address": schema.StringAttribute{
320320
Description: descriptions["external_address"],
321-
Optional: true,
321+
Required: true,
322322
PlanModifiers: []planmodifier.String{
323323
stringplanmodifier.RequiresReplace(),
324324
},
@@ -345,17 +345,15 @@ The example below creates the supporting infrastructure using the STACKIT Terraf
345345
},
346346
"port": schema.Int64Attribute{
347347
Description: descriptions["port"],
348-
Optional: true,
349-
Computed: true,
348+
Required: true,
350349
PlanModifiers: []planmodifier.Int64{
351350
int64planmodifier.RequiresReplace(),
352351
int64planmodifier.UseStateForUnknown(),
353352
},
354353
},
355354
"protocol": schema.StringAttribute{
356355
Description: descriptions["protocol"],
357-
Optional: true,
358-
Computed: true,
356+
Required: true,
359357
PlanModifiers: []planmodifier.String{
360358
stringplanmodifier.RequiresReplace(),
361359
stringplanmodifier.UseStateForUnknown(),
@@ -378,8 +376,7 @@ The example below creates the supporting infrastructure using the STACKIT Terraf
378376
},
379377
"target_pool": schema.StringAttribute{
380378
Description: descriptions["target_pool"],
381-
Optional: true,
382-
Computed: true,
379+
Required: true,
383380
PlanModifiers: []planmodifier.String{
384381
stringplanmodifier.RequiresReplace(),
385382
stringplanmodifier.UseStateForUnknown(),
@@ -424,8 +421,7 @@ The example below creates the supporting infrastructure using the STACKIT Terraf
424421
},
425422
"role": schema.StringAttribute{
426423
Description: descriptions["role"],
427-
Optional: true,
428-
Computed: true,
424+
Required: true,
429425
PlanModifiers: []planmodifier.String{
430426
stringplanmodifier.RequiresReplace(),
431427
stringplanmodifier.UseStateForUnknown(),

0 commit comments

Comments
 (0)