⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

STACKITLB-798 | add ALB TF provider#1198

Open
david-mey-STACKIT wants to merge 1 commit intostackitcloud:mainfrom
david-mey-STACKIT:main
Open

STACKITLB-798 | add ALB TF provider#1198
david-mey-STACKIT wants to merge 1 commit intostackitcloud:mainfrom
david-mey-STACKIT:main

Conversation

@david-mey-STACKIT
Copy link

Description

STACKITLB-798

Add Application Load Balancer provider (API: https://docs.api.stackit.cloud/documentation/alb/version/v2)

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@h3adex
Copy link
Contributor

h3adex commented Feb 6, 2026

imo we should use stackit_application_loadbalancer instead of stackit_alb as resource/datasource naming.

github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.1
github.com/teambition/rrule-go v1.8.2
golang.org/x/mod v0.30.0
k8s.io/utils v0.0.0-20260108192941-914a6e750570
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add a new module just for a to pointer utils function.
We already have the same function in the core module of our SDK. Replace the ptr.to() to utils.Ptr()

The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the network, network interface, a public IP address and server resources.
---

# stackit_alb (Data Source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @h3adex already suggested, I would prefer as well that the datasource and resource is named application_load_balancer. This makes it easier for first time users to understand for what resource and datasource

Comment on lines +12 to +15
## Setting up supporting infrastructure


The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the network, network interface, a public IP address and server resources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description doesn't fit to the datasource

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max acc test is failing

    alb_acc_test.go:305: Step 1/4 error: Error running apply: exit status 1
        
        Error: Error updating Application Load Balancer
        
          with stackit_alb.loadbalancer,
          on terraform_plugin_test.tf line 169, in resource "stackit_alb" "loadbalancer":
         169: resource "stackit_alb" "loadbalancer" {
        
        Calling API for create: 400 Bad Request, status code 400, Body:
        {
          "code": 3,
          "message": "one or more fields are invalid",
          "details": [
            {
              "@type": "type.googleapis.com/google.rpc.BadRequest.FieldViolation",
              "field": "loadBalancer.listeners[0].https.certificateConfig.certificateIds[0]",
              "description": "The specified certificate \"name-v1-8c81bd317af8a03b8ef0851ccb074eb17d1ad589b540446244a5e593f78ef820\" does not exist."
            }
          ]
        }
--- FAIL: TestAccALBResourceMax (117.56s)

Comment on lines +20 to +21
if providerData.LoadBalancerCustomEndpoint != "" {
apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.LoadBalancerCustomEndpoint))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong custom endpoint

Description: descriptions["options"],
Computed: true,
Attributes: map[string]schema.Attribute{
"acl": schema.SetAttribute{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be close to the api names. And this is actually an objects which has a property allowed_source_ranges. Keep the struct like in the api, because when the api changes in the future, we can't adjust the provider like the api is adjusted

Suggested change
"acl": schema.SetAttribute{
"access_control": schema. SingleNestedAttribute{

resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this function here. You may need to update your branch

Suggested change
}
}
ctx = core.InitProviderContext(ctx)

)
resp.State.RemoveResource(ctx)
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
ctx = core.LogResponse(ctx)

&resp.Diagnostics,
err,
"Reading application load balancer",
fmt.Sprintf("Load balancer with name %q does not exist in project %q.", name, projectId),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Sprintf("Load balancer with name %q does not exist in project %q.", name, projectId),
fmt.Sprintf("Application load balancer with name %q does not exist in project %q.", name, projectId),

if resp.Diagnostics.HasError() {
return
}
tflog.Info(ctx, "Load balancer read")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tflog.Info(ctx, "Load balancer read")
tflog.Info(ctx, "Application load balancer read")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants