diff --git a/pkg/plan_modifier/data_group_custom_diff.go b/pkg/plan_modifier/data_group_custom_diff.go index 0df65780..8da0e977 100644 --- a/pkg/plan_modifier/data_group_custom_diff.go +++ b/pkg/plan_modifier/data_group_custom_diff.go @@ -41,30 +41,6 @@ func (m CustomDataGroupDiffModifier) PlanModifyList(ctx context.Context, req pla return } - for _, pDg := range planDgsObs { - // 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(""), - }), - }) - } - } - mapState := tfsdk.State{Schema: req.Plan.Schema, Raw: req.Plan.Raw} diag = mapState.SetAttribute(ctx, path.Root("data_groups"), planDgsObs) if diag.ErrorsCount() > 0 {