Skip to content

Feat/dns zone observability extension#1540

Open
SerseusWasTaken wants to merge 4 commits into
mainfrom
feat/dns-zone-observability-extension
Open

Feat/dns zone observability extension#1540
SerseusWasTaken wants to merge 4 commits into
mainfrom
feat/dns-zone-observability-extension

Conversation

@SerseusWasTaken

Copy link
Copy Markdown
Contributor

Description

relates to #STACKITTPR-319 and closes #941

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)

@SerseusWasTaken SerseusWasTaken requested a review from a team as a code owner June 26, 2026 06:18
@SerseusWasTaken SerseusWasTaken marked this pull request as draft June 26, 2026 06:21
@SerseusWasTaken SerseusWasTaken force-pushed the feat/dns-zone-observability-extension branch 5 times, most recently from f3b6422 to fc58f24 Compare June 26, 2026 07:40
@SerseusWasTaken SerseusWasTaken marked this pull request as ready for review June 26, 2026 07:48
@github-actions

github-actions Bot commented Jul 4, 2026

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 Jul 4, 2026
@SerseusWasTaken SerseusWasTaken force-pushed the feat/dns-zone-observability-extension branch from fc58f24 to 1eb0838 Compare July 8, 2026 06:12
@github-actions github-actions Bot removed the Stale PR is marked as stale due to inactivity. label Jul 9, 2026
Comment thread stackit/internal/services/dns/zone/resource.go Outdated
Comment thread stackit/internal/services/dns/zone/resource.go Outdated
Comment thread stackit/internal/services/dns/zone/resource.go Outdated
Comment thread stackit/internal/services/dns/zone/resource.go Outdated
Comment thread stackit/internal/services/dns/testdata/resource-max.tf Outdated
Comment thread stackit/internal/services/dns/dns_acc_test.go Outdated
@marceljk

Copy link
Copy Markdown
Contributor

When I create a dns_zone with observability enabled and remove the whole extension during an update, the terraform fails with an state drift.

resource "stackit_observability_instance" "observability" {
  project_id = var.project_id
  name       = "marcel-dns-test"
  plan_name  = "Observability-Metrics-Endpoint-100k-EU01"
}

resource "stackit_dns_zone" "dns_zone" {
  project_id    = var.project_id
  name          = "my-dns-zone"
  dns_name      = "tf-acc-a8d583413.stackit.gg"
  contact_email = "aa@bb.ccdd"
  type          = "primary"
  default_ttl   = 3600
  # Enable first the extension and remove it then for an update
  # extensions    = {
  #   observability = {
  #     observability_instance_id = stackit_observability_instance.observability.instance_id
  #   }
  # }
}

Error message:


│ Error: Provider produced inconsistent result after apply

│ When applying changes to stackit_dns_zone.dns_zone, provider "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced an unexpected new value: .extensions: was null, but now
│ cty.ObjectVal(map[string]cty.Value{"observability":cty.ObjectVal(map[string]cty.Value{"observability_instance_id":cty.StringVal("be4a8756-09ff-4b93-a861-bfb4f84ab2bf"), "state":cty.StringVal("CREATING")})}).

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

@SerseusWasTaken

Copy link
Copy Markdown
Contributor Author

When I create a dns_zone with observability enabled and remove the whole extension during an update, the terraform fails with an state drift.

resource "stackit_observability_instance" "observability" {
  project_id = var.project_id
  name       = "marcel-dns-test"
  plan_name  = "Observability-Metrics-Endpoint-100k-EU01"
}

resource "stackit_dns_zone" "dns_zone" {
  project_id    = var.project_id
  name          = "my-dns-zone"
  dns_name      = "tf-acc-a8d583413.stackit.gg"
  contact_email = "aa@bb.ccdd"
  type          = "primary"
  default_ttl   = 3600
  # Enable first the extension and remove it then for an update
  # extensions    = {
  #   observability = {
  #     observability_instance_id = stackit_observability_instance.observability.instance_id
  #   }
  # }
}

Error message:

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to stackit_dns_zone.dns_zone, provider "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced an unexpected new value: .extensions: was null, but now
│ cty.ObjectVal(map[string]cty.Value{"observability":cty.ObjectVal(map[string]cty.Value{"observability_instance_id":cty.StringVal("be4a8756-09ff-4b93-a861-bfb4f84ab2bf"), "state":cty.StringVal("CREATING")})}).
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

State drift is fixed, but there seems to be a bug in the API which allows to link invalid observability instances. We will wait with this PR until the issue is addressed

@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/dns 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/dns/zone 21.78% (+3.22%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/dns/zone/datasource.go 0.00% (ø) 64 0 64
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/dns/zone/resource.go 27.10% (+3.31%) 262 (+35) 71 (+17) 191 (+18) 👍

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/dns/dns_acc_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/dns/zone/resource_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNS Zone Observability Extension

2 participants