Skip to content

Onboarding Intake(2/3): Onboard intakes resource - #1689

Open
devanshcache wants to merge 7 commits into
stackitcloud:mainfrom
stackit-intake:onboard-intakes-resource
Open

devanshcache wants to merge 7 commits into
stackitcloud:mainfrom
stackit-intake:onboard-intakes-resource

Conversation

@devanshcache

Copy link
Copy Markdown
Contributor

Description

This PR onboards the new STACKIT Intake (ticket) service into the Terraform provider.

Intake is composed of three components:

Intake Runners: dedicated, isolated runtime data ingestion environment
Intakes: a specific data stream or topic within an Intake Runner
Intake Users: provides secure access credentials for your applications to connect to your Intake

This PR contains the Intakes part only to make a quicker and less overwhelming review.

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)

@devanshcache
devanshcache requested a review from a team as a code owner August 14, 2026 07:43
@cgoetz-inovex

Copy link
Copy Markdown
Contributor

Hi @devanshcache ,
thanks for your contribution, I've created an internal tracking issue for the review of your changes

@devanshcache

Copy link
Copy Markdown
Contributor Author

Hi @cgoetz-inovex, Thank you looking forward for your feedback :)

@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions Bot added the Stale PR is marked as stale due to inactivity. label Aug 25, 2026
Comment thread examples/resources/stackit_intakes/resource.tf
Comment thread stackit/internal/services/intake/intakes/datasource.go Outdated
Comment thread stackit/internal/services/intake/intakes/datasource.go Outdated
Comment thread stackit/internal/services/intake/intakes/datasource.go Outdated
Comment thread stackit/internal/services/intake/intakes/datasource.go
maps.Copy(tempConfig, base)
tempConfig["intake_name"] = config.StringVariable(intakeNameMaxUpd)
tempConfig["description"] = config.StringVariable("Updated full intake description")
tempConfig["max_messages_per_hour"] = config.IntegerVariable(1100)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would add also update values for the catalog stuff here

}
}

func testIntakesConfigVarsMin() config.Variables {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the API docs only uri and warhouse of catalog is marked as required. So the dremio part could be removed here (auth not marked as required). API doc bug or intentionally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is intentional in the API:

  • API allows catalog.auth to be omitted (defaulting to type: none on the backend) to support unauthenticated Iceberg catalogs. In the provider schema, all Dremio fields are marked Optional: true.
  • However in live acceptance tests (TestAccIntakesMin) terraform waits for the intake to reach active state. Without a reachable Iceberg catalogthe intake fails to connect and enters a failed state, breaking the test waiter.
  • because Dremio is currently the only live Iceberg catalog available in our test environment, provisioning Dremio was necessary for the runner to connect successfully and reach active.

Comment thread stackit/internal/services/intake/intakes/resource.go Outdated
Comment thread stackit/internal/services/intake/intakes/resource.go Outdated
}

// getDremioPAT authenticates against Dremio UI API, enables PAT support key, resolves user UUID, and issues a PAT
func getDremioPAT(ctx context.Context, uiEndpoint, username, password string) (string, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function does not feel right.
Can you explain please why this is needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just had a deeper look into this and found that there is a documentation regarding the dremio PAT (https://docs.stackit.cloud/products/data-and-ai/intake/how-tos/configure-dremio-for-stackit-intake-integration/).

How is the customer supposed to use this in terraform? Such a getDremioPAT() function cannot be used by a customer. First a dremio instance needs to be created, then the customer needs to activate PAT for that instance via UI, get the dremio PAT via UI as well and is then able to create a intake instance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please note that this is an acceptance test not a Terraform resource. To run it, we need to create an Intake instance, which requires obtaining a Dremio PAT.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I am aware of that.
Those questions apply in general.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can we resolve this comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't actually resolve my original concern. My point was never about the test itself, but about what getDremioPAT() exposes:

There is currently no way for a customer to obtain a Dremio PAT through Terraform or any STACKIT API. The real flow today is:

  1. create the Dremio instance and user via Terraform
  2. log into the Dremio UI by hand
  3. manually flip on PAT support
  4. manually generate the token and paste it into dremio_personal_access_token_wo.

That's not a test artifact, that's the actual customer experience and honestly, it's a mess. Forcing a manual UI detour just to get a secret into the config defeats the point of using Terraform at all.

We already have the right pattern elsewhere in this provider: stackit_telemetryrouter_accesstoken, stackit_logs_accesstoken, stackit_modelexperiments_token, stackit_modelserving_token, and stackit_edgecloud_token all mint their secret server-side via the STACKIT API at resource create time, using the STACKIT project/service-account credentials the customer already has. No login against a separate system required. That's the correct shape for this too: a STACKIT API endpoint that issues a Dremio PAT for a given Dremio user, authenticated with STACKIT project credentials, not Dremio username/password.

getDremioPAT() in the acceptance test is effectively proving this gap by reverse-engineering undocumented Dremio UI endpoints (/apiv2/settings/..., /api/v3/user/...) just to get the test to run end-to-end. I don't want that pattern to exist even as a test helper. If the only way to make our own acceptance test work is to script around Dremio's internal UI API, that's a signal the product is missing a real API, not that the test needs a workaround.

@devanshcache devanshcache Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. We agree that a native token-minting API/resource is the ideal long-term design.

Since token issuance is not yet available via the public API, the resource was designed to take the token as a credential input.

To address the concern with getDremioPAT() and avoid undocumented UI endpoints in the test suite, we could remove the helper entirely and load the token via an environment variable in the acceptance test (skipping the step if not set).

However, this requires maintaining a long-lived, pre-configured Dremio instance for CI and Dremio PATs have a maximum lifetime of 180 days, it would require periodic manual rotation to keep CI running.

Would you prefer moving to the environment variable approach despite the rotation overhead or is there another direction you would recommend?

@Fyusel Fyusel removed the Stale PR is marked as stale due to inactivity. label Sep 1, 2026
@github-actions

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions Bot added the Stale PR is marked as stale due to inactivity. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has internal tracking issue Stale PR is marked as stale due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants