From 4cde21501c50dab41425569da7bfc71861289937 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 8 Nov 2017 11:31:16 -0800 Subject: [PATCH] core: more explanation when a provider block cannot be found Our new resource-to-provider matching is stricter about explicitly matching aliases when config is present (no longer automatically inherited) and with locating providers to destroy removed resources. With this in mind, this is an attempt to expand slightly on this error message now that users are more likely to see it. In future it would be nice to do some explicit validation of this a bit closer to the UI, so we can have room for more explanatory text, but this additional messaging is intended to help users understand why they might be seeing this message after removing a provider configuration block from configuration, whether directly or as a side-effect of removing a module. --- terraform/transform_provider.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terraform/transform_provider.go b/terraform/transform_provider.go index 6d7ab28e9..3cd915ddd 100644 --- a/terraform/transform_provider.go +++ b/terraform/transform_provider.go @@ -101,8 +101,9 @@ func (t *ProviderTransformer) Transform(g *Graph) error { if target == nil { err = multierror.Append(err, fmt.Errorf( - "%s: provider %s couldn't be found", - dag.VertexName(v), p)) + "%s: configuration for %s is not present; a provider configuration block is required for all operations", + dag.VertexName(v), p, + )) break }