allow the evaluation of resource being destroyed

During a full destroy, providers may reference resources that are going
to be destroyed as well. We currently cannot change this behavior, so we
need to allow the evaluation and try to prevent it from leaking into as
many other places as possible. Another transformer to try and protect
the values in locals, variables and outputs will be added to enforce
destroy ordering when possible.
This commit is contained in:
James Bardin 2020-07-18 10:28:14 -04:00
parent 6f9d2c51e2
commit d1dba76132
1 changed files with 5 additions and 1 deletions

View File

@ -662,7 +662,11 @@ func (d *evaluationStateData) GetResource(addr addrs.Resource, rng tfdiags.Sourc
// instances will be in the state, as they are not destroyed until // instances will be in the state, as they are not destroyed until
// after their dependants are updated. // after their dependants are updated.
if change.Action == plans.Delete { if change.Action == plans.Delete {
continue // FIXME: we should not be evaluating resources that are going
// to be destroyed, but this needs to happen always since
// providers need to evaluate their configuration during a full
// destroy, even of they depend on resources being destroyed.
// continue
} }
} }