Skip to content

Conversation

@jbardin
Copy link
Member

@jbardin jbardin commented Dec 10, 2025

Add ability to forward PlannedPrivate data between plans

Terraform providers sometimes want to be able to plan a computed field
which may not be deterministically generated. For example, a random GUID
could be generated during plan, making the overall Terraform plan more
precise, but there is currently no way to carry that planned value
forward to apply.

The problem is that there are always two entirely independent plans for
every resource change. Terraform compares these two plans for
consistency, so a provider may not return a different computed value,
but there is no way for the provider to see what the prior planned value
was. This means that a planned value which is not reproducible from the
given inputs is not plan-able at all.

This PR allows Terraform to take the private data from the first plan,
which is usually discarded, and send it along in the second plan
request. The provider can then use that data to recreate any previously
planned values, either because they are stored directly, or contain
enough seed data to recreate the same result.

Terraform providers sometimes want to be able to plan a computed field
which may not be deterministically generated. For example, a random GUID
could be generated during plan, making the overall Terraform plan more
precise, but there is currently no way to carry that planned value
forward to apply.

The problem is that there are always two entirely independent plans for
every resource change. Terraform compares these two plans for
consistency, so a provider may not return a different computed value,
but there is no way for the provider to see what the prior planned value
was. This means that a planned value which is not reproducible from the
given inputs is not plan-able at all.

This PR allows Terraform to take the private data from the first plan,
which is usually discarded, and send it along in the second plan
request. The provider can then use that data to recreate any previously
planned values, either because they are stored directly, or contain
enough seed data to recreate the same result.
@github-actions
Copy link
Contributor

Changelog Warning

Currently this PR would target a v1.15 release. Please add a changelog entry for in the .changes/v1.15 folder, or discuss which release you'd like to target with your reviewer. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.

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