Description
When creating (and likely updating) a stackit_intake_runner resource, Terraform reports a 404 error during the post-create readiness wait, even though the Intake Runner itself is created successfully and becomes active. As a result, Terraform marks the resource as tainted, which would cause a destroy+recreate on the next apply of a perfectly healthy, running resource.
Root Cause
In stackit/internal/services/intake/runner/resource.go, both the Create and Update functions call the wrong SDK wait handler — the one for the Intake resource instead of the Intake Runner resource:
// Create(), line 255:
_, err = wait.CreateIntakeWaitHandler(ctx, r.client.DefaultAPI, projectId, region, runnerResp.GetId()).WaitWithContext(ctx)
// Update(), line 354:
_, err = wait.UpdateIntakeWaitHandler(ctx, r.client.DefaultAPI, projectId, region, runnerId).WaitWithContext(ctx)
wait.CreateIntakeWaitHandler / wait.UpdateIntakeWaitHandler (from stackit-sdk-go/services/intake/v1betaapi/wait) call GetIntake(...) internally — i.e. they look up an Intake, not an Intake Runner — but they're being passed the Runner's ID. Since no Intake with that ID exists, the SDK call returns 404.
The SDK already provides the correct handlers, which the provider simply isn't calling:
wait.CreateIntakeRunnerWaitHandler(...) (should be used in Create)
wait.UpdateIntakeRunnerWaitHandler(...) (should be used in Update)
For reference, Delete() (line 407) correctly calls wait.DeleteIntakeRunnerWaitHandler, which confirms the correct pattern already exists elsewhere in the same file — this looks like a copy-paste mistake in Create/Update only.
Steps to Reproduce
resource "stackit_intake_runner" "this" {
project_id = "<project-id>"
name = "example-runner"
max_message_size_kib = 256
max_messages_per_hour = 20000
}
Run terraform apply.
Expected Behavior
Resource is created and Terraform waits on the Intake Runner's own readiness state.
Actual Behavior
Error: Error creating runner
with stackit_intake_runner.this,
on main.tf line X, in resource "stackit_intake_runner" "this":
X: resource "stackit_intake_runner" "this" {
Intake runner creation waiting: 404 Not Found, status code 404, Body: {"message":"failed to get intake: Intake.api.intake.stackit.cloud
"intake-<runner-id>" not found"}
Terraform marks the resource tainted in state, even though stackit beta intake runner list confirms the runner was created and is "state": "active".
Impact
Running terraform apply again while the resource is tainted would destroy and recreate a healthy, already-running Intake Runner (new ID, breaking anything referencing the old one — e.g. an Intake created via stackit beta intake create --runner-id ...), and would presumably hit the same 404 again on recreation, since Create() has the same bug.
Current workaround: terraform untaint on the affected resource(s) after the error.
Versions
stackitcloud/stackit provider: confirmed present in v0.101.0 through v0.105.0 (latest at time of writing)
- Terraform: 1.15.x
Description
When creating (and likely updating) a
stackit_intake_runnerresource, Terraform reports a 404 error during the post-create readiness wait, even though the Intake Runner itself is created successfully and becomesactive. As a result, Terraform marks the resource astainted, which would cause a destroy+recreate on the nextapplyof a perfectly healthy, running resource.Root Cause
In
stackit/internal/services/intake/runner/resource.go, both theCreateandUpdatefunctions call the wrong SDK wait handler — the one for the Intake resource instead of the Intake Runner resource:wait.CreateIntakeWaitHandler/wait.UpdateIntakeWaitHandler(fromstackit-sdk-go/services/intake/v1betaapi/wait) callGetIntake(...)internally — i.e. they look up an Intake, not an Intake Runner — but they're being passed the Runner's ID. Since no Intake with that ID exists, the SDK call returns 404.The SDK already provides the correct handlers, which the provider simply isn't calling:
wait.CreateIntakeRunnerWaitHandler(...)(should be used inCreate)wait.UpdateIntakeRunnerWaitHandler(...)(should be used inUpdate)For reference,
Delete()(line 407) correctly callswait.DeleteIntakeRunnerWaitHandler, which confirms the correct pattern already exists elsewhere in the same file — this looks like a copy-paste mistake inCreate/Updateonly.Steps to Reproduce
Run
terraform apply.Expected Behavior
Resource is created and Terraform waits on the Intake Runner's own readiness state.
Actual Behavior
Terraform marks the resource
taintedin state, even thoughstackit beta intake runner listconfirms the runner was created and is"state": "active".Impact
Running
terraform applyagain while the resource is tainted would destroy and recreate a healthy, already-running Intake Runner (new ID, breaking anything referencing the old one — e.g. anIntakecreated viastackit beta intake create --runner-id ...), and would presumably hit the same 404 again on recreation, since Create() has the same bug.Current workaround:
terraform untainton the affected resource(s) after the error.Versions
stackitcloud/stackitprovider: confirmed present in v0.101.0 through v0.105.0 (latest at time of writing)