Skip to content

Conversation

@cgoetz-inovex
Copy link
Contributor

@cgoetz-inovex cgoetz-inovex commented Dec 12, 2025

  • add resource with examples
  • add data source with examples
  • add acceptance tests

Description

relates to STACKITTPR-448

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)

- add resource with examples
- add data source with examples
- add acceptance tests
@cgoetz-inovex cgoetz-inovex requested a review from a team as a code owner December 12, 2025 11:04
- rename git to logs in example
- add NoSeparator validator for instance-/project-id
- log responses and instance_ids
- rm redundant struct field docs
- mention possible status values in description
- test ConfigureClient
- use ElementsAs
@marceljk
Copy link
Contributor

When I run the following terraform config, the read of the data source fails

resource "stackit_logs_instance" "example" {
  display_name = "mj-test"
  project_id = var.project_id
  retention_days = 1
}

data "stackit_logs_instance" "example" {
  project_id = var.project_id
  instance_id = stackit_logs_instance.example.instance_id
}
╷
│ Error: Provider produced null object
│ 
│ Provider "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced a null value for data.stackit_logs_instance.example.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

@cgoetz-inovex
Copy link
Contributor Author

When I run the following terraform config, the read of the data source fails

resource "stackit_logs_instance" "example" {
  display_name = "mj-test"
  project_id = var.project_id
  retention_days = 1
}

data "stackit_logs_instance" "example" {
  project_id = var.project_id
  instance_id = stackit_logs_instance.example.instance_id
}
╷
│ Error: Provider produced null object
│ 
│ Provider "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced a null value for data.stackit_logs_instance.example.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

thanks, fixed

GokceGK
GokceGK previously approved these changes Jan 19, 2026
@github-actions
Copy link

Merging this branch changes the coverage (2 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit 1.52% (-0.02%) 👎
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core 21.62% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/instance 19.76% (+19.76%) 🎉
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/utils 77.78% (+77.78%) 🌟
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/testutil 6.57% (-0.15%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core/core.go 21.62% (ø) 37 8 29
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/instance/datasource.go 0.00% (ø) 43 (+43) 0 43 (+43)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/instance/resource.go 23.81% (+23.81%) 210 (+210) 50 (+50) 160 (+160) 🌟
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/utils/utils.go 77.78% (+77.78%) 9 (+9) 7 (+7) 2 (+2) 🌟
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/testutil/testutil.go 6.57% (-0.15%) 137 (+3) 9 128 (+3) 👎
github.com/stackitcloud/terraform-provider-stackit/stackit/provider.go 1.52% (-0.02%) 132 (+2) 2 130 (+2) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/instance/resource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/logs_acc_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/logs/utils/utils_test.go

@cgoetz-inovex cgoetz-inovex merged commit 90fe355 into main Jan 19, 2026
3 checks passed
@cgoetz-inovex cgoetz-inovex deleted the feat/STACKITTPR-448-logs-instance-datasource branch January 19, 2026 16:13
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.

4 participants