Onboarding Intake(2/3): Onboard intakes resource - #1689
Conversation
|
Hi @devanshcache , |
|
Hi @cgoetz-inovex, Thank you looking forward for your feedback :) |
|
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. |
| labels = { | ||
| "env" = "development" | ||
| } | ||
| } |
There was a problem hiding this comment.
Please also add "import-by-string-id.tf" (import statement)
|
|
||
| // Schema defines the schema for the data source | ||
| func (d *intakesDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { | ||
| descriptions := map[string]string{ //nolint:gosec // descriptions |
There was a problem hiding this comment.
The description can be shared between datasource and resource.
| Optional: true, | ||
| Description: descriptions["region"], | ||
| }, | ||
| "dremio_personal_access_token": schema.StringAttribute{ |
There was a problem hiding this comment.
access_token should not be stored in state.
Add write only here (see for example telemetrylink resource)
| Description: descriptions["runner_id"], | ||
| Computed: true, | ||
| }, | ||
| "name": schema.StringAttribute{ |
There was a problem hiding this comment.
This is "displayName" in the API, right?
If so this should be renamed to displayName to be consistent with the API docs.
Additionally a validator should be added.
| "description": schema.StringAttribute{ | ||
| Description: descriptions["description"], | ||
| Computed: true, | ||
| }, |
There was a problem hiding this comment.
deadLetterTopic and topic is missing?
| 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) |
There was a problem hiding this comment.
Would add also update values for the catalog stuff here
| } | ||
| } | ||
|
|
||
| func testIntakesConfigVarsMin() config.Variables { |
There was a problem hiding this comment.
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?
| }, | ||
| "catalog_uri": schema.StringAttribute{ | ||
| Description: descriptions["catalog_uri"], | ||
| Optional: true, |
There was a problem hiding this comment.
marked as required in API docs
| }, | ||
| "catalog_warehouse": schema.StringAttribute{ | ||
| Description: descriptions["catalog_warehouse"], | ||
| Optional: true, |
There was a problem hiding this comment.
same here: marked as required in api docs (https://docs.api.stackit.cloud/documentation/intake/version/v1beta#tag/intakes/operation/create-intake)
| } | ||
|
|
||
| // 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) { |
There was a problem hiding this comment.
This function does not feel right.
Can you explain please why this is needed?
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
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)