From 4ccf1f58dfccec1b82637d6cbad3c88a606eac6f Mon Sep 17 00:00:00 2001 From: Grant Palmer Date: Thu, 26 Dec 2024 19:08:43 -0500 Subject: [PATCH] fix iteration --- datadog/fwprovider/resource_datadog_azure_integration.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datadog/fwprovider/resource_datadog_azure_integration.go b/datadog/fwprovider/resource_datadog_azure_integration.go index 522e2487f..ec4274bc1 100644 --- a/datadog/fwprovider/resource_datadog_azure_integration.go +++ b/datadog/fwprovider/resource_datadog_azure_integration.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" frameworkPath "github.com/hashicorp/terraform-plugin-framework/path" - "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -358,10 +358,10 @@ func (r *integrationAzureResource) buildIntegrationAzureRequestBody(ctx context. datadogDefinition.SetMetricsEnabledDefault(state.MetricsEnabledDefault.ValueBool()) datadogDefinition.SetUsageMetricsEnabled(state.UsageMetricsEnabled.ValueBool()) - resourceProviderConfigsPayload := make([]datadogV1.ResourceProviderConfig, len(state.ResourceProviderConfigs)) - for i, resourceProviderConfig := range state.ResourceProviderConfigs { + resourceProviderConfigsPayload := make([]datadogV1.ResourceProviderConfig, len(state.ResourceProviderConfigs.Elements())) + for i, resourceProviderConfig := range state.ResourceProviderConfigs.Elements() { resourceProviderConfigsPayload[i] = datadogV1.ResourceProviderConfig{ - Namespace: resourceProviderConfig.Namespace.ValueString(), + Namespace: resourceProviderConfig.Namespace.ValueString(), MetricsEnabled: resourceProviderConfig.MetricsEnabled.ValueString(), } }