From ea27bf0698ad2be91bdcfebb56cc9e062e6934be Mon Sep 17 00:00:00 2001 From: "PC-2NR0VQ3\\wai.wong" Date: Tue, 26 Nov 2024 12:22:22 +0000 Subject: [PATCH] fix: ip description remove --- pkg/plan_modifier/data_group_custom_diff.go | 23 --------------------- 1 file changed, 23 deletions(-) diff --git a/pkg/plan_modifier/data_group_custom_diff.go b/pkg/plan_modifier/data_group_custom_diff.go index 8da0e977..bd175f31 100644 --- a/pkg/plan_modifier/data_group_custom_diff.go +++ b/pkg/plan_modifier/data_group_custom_diff.go @@ -6,7 +6,6 @@ import ( "reflect" "github.com/EnterpriseDB/terraform-provider-biganimal/pkg/models/pgd/terraform" - "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -102,28 +101,6 @@ func (m CustomDataGroupDiffModifier) PlanModifyList(ctx context.Context, req pla pDg.Storage.Iops = sDg.Storage.Iops pDg.Storage.Throughput = sDg.Storage.Throughput - // fix to set the correct allowed ip ranges to allow all if a PGD data group has private networking set as true - if pDg.PrivateNetworking != nil && *pDg.PrivateNetworking { - pDg.AllowedIpRanges = types.SetValueMust(pDg.AllowedIpRanges.ElementType(ctx), []attr.Value{ - types.ObjectValueMust( - pDg.AllowedIpRanges.ElementType(ctx).(types.ObjectType).AttributeTypes(), - map[string]attr.Value{ - "cidr_block": types.StringValue("0.0.0.0/0"), - "description": types.StringValue("To allow all access"), - }), - }) - // fix to set the correct allowed ip ranges for PGD data group if allowed ip ranges length is 0 - } else if pDg.AllowedIpRanges.IsNull() || len(pDg.AllowedIpRanges.Elements()) == 0 { - pDg.AllowedIpRanges = types.SetValueMust(pDg.AllowedIpRanges.ElementType(ctx), []attr.Value{ - types.ObjectValueMust( - pDg.AllowedIpRanges.ElementType(ctx).(types.ObjectType).AttributeTypes(), - map[string]attr.Value{ - "cidr_block": types.StringValue("0.0.0.0/0"), - "description": types.StringValue(""), - }), - }) - } - // if private networking has change then connection string will change if sDg.PrivateNetworking != pDg.PrivateNetworking { pDg.Connection = types.StringUnknown()