Skip to content

Conversation

@a-khaledf
Copy link
Contributor

Problem

Fixes AXM-10068 AXM-10069

When creating or updating a dataset, if the primary operation succeeded but the subsequent UpdateMapFields call failed, the Terraform state was not updated with the created/updated dataset. This caused:

  • Orphaned resources: Datasets created in Axiom but not tracked in Terraform state
  • "Already exists" errors: On retry, Terraform would attempt to create the dataset again
  • State drift: Users couldn't manage the resource without manual intervention (import, etc.)

Changes

  1. Fixed Create function (resource_dataset.go)
  • State is now set immediately after successful dataset creation
  • UpdateMapFields is performed as a secondary operation
  • If UpdateMapFields fails, the dataset is already tracked in state (preventing orphaning)
  1. Fixed Update function (resource_dataset.go)
  • Applied the same pattern to the Update function for consistency.
  1. Updated documentation (docs/resources/dataset.md)
  • Added missing kind field to the documentation.

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.

1 participant