From 718a67897d028e74ade06e48d7b7d95fc94fc9c8 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Tue, 8 Dec 2020 19:18:04 +0000 Subject: [PATCH] backport of commit 107dc0c34f50c6fbeeba8e8705b984c55ec8548a --- builtin/providers/terraform/data_source_state.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builtin/providers/terraform/data_source_state.go b/builtin/providers/terraform/data_source_state.go index a2c776a223..ca798d4cce 100644 --- a/builtin/providers/terraform/data_source_state.go +++ b/builtin/providers/terraform/data_source_state.go @@ -5,6 +5,7 @@ import ( "log" "github.com/hashicorp/terraform/backend" + "github.com/hashicorp/terraform/backend/remote" "github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/providers" "github.com/hashicorp/terraform/tfdiags" @@ -215,6 +216,12 @@ func getBackend(cfg cty.Value) (backend.Backend, cty.Value, tfdiags.Diagnostics) return nil, cty.NilVal, diags } + // If this is the enhanced remote backend, we want to disable the version + // check, because this is a read-only operation + if rb, ok := b.(*remote.Remote); ok { + rb.IgnoreVersionConflict() + } + return b, newVal, diags }