STACKITLB-798 | add ALB TF provider#1198
STACKITLB-798 | add ALB TF provider#1198david-mey-STACKIT wants to merge 1 commit intostackitcloud:mainfrom
Conversation
|
imo we should use |
| 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
| ## 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. |
There was a problem hiding this comment.
The description doesn't fit to the datasource
There was a problem hiding this comment.
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)| if providerData.LoadBalancerCustomEndpoint != "" { | ||
| apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.LoadBalancerCustomEndpoint)) |
| Description: descriptions["options"], | ||
| Computed: true, | ||
| Attributes: map[string]schema.Attribute{ | ||
| "acl": schema.SetAttribute{ |
There was a problem hiding this comment.
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
| "acl": schema.SetAttribute{ | |
| "access_control": schema. SingleNestedAttribute{ |
| resp.Diagnostics.Append(diags...) | ||
| if resp.Diagnostics.HasError() { | ||
| return | ||
| } |
There was a problem hiding this comment.
Add this function here. You may need to update your branch
| } | |
| } | |
| ctx = core.InitProviderContext(ctx) | |
| ) | ||
| resp.State.RemoveResource(ctx) | ||
| return | ||
| } |
There was a problem hiding this comment.
| } | |
| } | |
| 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), |
There was a problem hiding this comment.
| 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") |
There was a problem hiding this comment.
| tflog.Info(ctx, "Load balancer read") | |
| tflog.Info(ctx, "Application load balancer read") |
Description
STACKITLB-798
Add Application Load Balancer provider (API: https://docs.api.stackit.cloud/documentation/alb/version/v2)
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)