Skip to content

[datadog_custom_allocation_rule] Fix "inconsistent result after apply" on in-place update#3845

Open
billykern wants to merge 1 commit into
DataDog:masterfrom
billykern:fix-custom-allocation-rule-update-consistency
Open

[datadog_custom_allocation_rule] Fix "inconsistent result after apply" on in-place update#3845
billykern wants to merge 1 commit into
DataDog:masterfrom
billykern:fix-custom-allocation-rule-update-consistency

Conversation

@billykern
Copy link
Copy Markdown

Fixes #3829

updated, version, and last_modified_user_uuid are computed attributes the API rewrites on every update, but they used UseStateForUnknown(), which pins the planned value to prior state. On an in-place update the post-apply value differs from the pinned plan value, so Terraform fails the consistency check even though the update succeeded server-side. created keeps the modifier since it never changes after creation.

The existing ...Update acceptance test missed this because it also changes rule_name (a RequiresReplace field), which destroys and recreates the rule rather than updating it in place. Added ...InPlaceUpdate, which changes only costs_to_allocate, exercising the PATCH path that triggers the bug.

…update

Remove UseStateForUnknown() from the computed updated, version, and
last_modified_user_uuid attributes. The API changes these on every
update, so pinning them to prior state failed Terraform's post-apply
consistency check. Adds an in-place-update acceptance test that the
existing update test missed (it changes rule_name, forcing replacement).
@billykern billykern requested a review from a team as a code owner June 1, 2026 23:49
@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented Jun 3, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

PR Integration Tests | integration-tests   View in Datadog   GitHub Actions

See error Missing required input: api_key.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 486ef47 | Docs | Datadog PR Page | Give us feedback!

@fpighi
Copy link
Copy Markdown
Member

fpighi commented Jun 3, 2026

We have an issue with integration tests coming from forks right now, so it's ok to ignore that failure.

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.

datadog_custom_allocation_rule: "Provider produced inconsistent result after apply" on updated timestamp during update

3 participants