From af8afc77df59f07326fce3d80d6303a11c10fc34 Mon Sep 17 00:00:00 2001 From: Elie Date: Tue, 16 Nov 2021 14:42:33 +0100 Subject: [PATCH] Force azure provider registration to false. Azure provider registration allow terraform provider to automatically register azure resource providers. In our context we are running read only so we do not want to try to enable them during the scan. Without this, a driftctl scan will try to register resource providers since it is done in the gRPC configure call. --- pkg/remote/azurerm/provider.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/remote/azurerm/provider.go b/pkg/remote/azurerm/provider.go index 15fd735e..4f89e8e4 100644 --- a/pkg/remote/azurerm/provider.go +++ b/pkg/remote/azurerm/provider.go @@ -38,11 +38,12 @@ func NewAzureTerraformProvider(version string, progress output.Progress, configD Name: p.name, GetProviderConfig: func(_ string) interface{} { c := p.GetConfig() - return map[string]string{ - "subscription_id": c.SubscriptionID, - "tenant_id": c.TenantID, - "client_id": c.ClientID, - "client_secret": c.ClientSecret, + return map[string]interface{}{ + "subscription_id": c.SubscriptionID, + "tenant_id": c.TenantID, + "client_id": c.ClientID, + "client_secret": c.ClientSecret, + "skip_provider_registration": true, } }, }, progress)