diff --git a/internal/terraform/transform_config.go b/internal/terraform/transform_config.go index 6cb42b6200..f404c80d0a 100644 --- a/internal/terraform/transform_config.go +++ b/internal/terraform/transform_config.go @@ -28,6 +28,9 @@ type ConfigTransformer struct { // Mode will only add resources that match the given mode ModeFilter bool Mode addrs.ResourceMode + + // destroyPlan indicated this is being called from a destroy plan. + destroyPlan bool } func (t *ConfigTransformer) Transform(g *Graph) error { @@ -36,6 +39,11 @@ func (t *ConfigTransformer) Transform(g *Graph) error { return nil } + // Configured resource are not added for a destroy plan + if t.destroyPlan { + return nil + } + // Start the transformation process return t.transform(g, t.Config) }