terraform icon indicating copy to clipboard operation
terraform copied to clipboard

stackeval: Don't fail when data resource is removed

Open apparentlymart opened this issue 2 years ago • 0 comments

Due to an oversight in our handling of resource instance objects that are neither in configuration nor plan -- which is true for data resources that have since been removed from the configuration -- we were generating plan change objects that were lacking a provider configuration address, which made them syntactically invalid and thus not reloadable using the raw plan parser.

This is a bit of a strange situation since we don't technically need a provider configuration address for these; all we're going to do is just unceremoniously delete them from the state during apply anyway. However, we always have the provider configuration address available anyway, so adding this in here is overall simpler than changing the parser, the models it populates, and all of the downstream users of those models to treat this field as optional.

This commit is more test case than it is fix, since the fix was relatively straightforward once I had a test case to reproduce the problem it's fixing.

This fixes the non-public ticket TF-13366.

apparentlymart avatar Feb 24 '24 00:02 apparentlymart