From db09ea1082e21b2d5965a65e71c64ee9ac89705a Mon Sep 17 00:00:00 2001 From: Ihab Zhaika Date: Tue, 12 Sep 2023 18:14:12 +0300 Subject: [PATCH] Fail when switching to free and having extensions Signed-off-by: Ihab Zhaika --- .../security_center_subscription_pricing_resource.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/services/securitycenter/security_center_subscription_pricing_resource.go b/internal/services/securitycenter/security_center_subscription_pricing_resource.go index afe6fe0cde4f4..4c6a772508765 100644 --- a/internal/services/securitycenter/security_center_subscription_pricing_resource.go +++ b/internal/services/securitycenter/security_center_subscription_pricing_resource.go @@ -120,6 +120,10 @@ func resourceSecurityCenterSubscriptionPricingUpdate(d *pluginsdk.ResourceData, }, } + if d.HasChange("extension") && pricing.Properties.PricingTier == "Free" { + return fmt.Errorf("Can not have enabled extensions when switching to free tier, please remove the extensions") + } + apiResponse, err := client.Get(ctx, id) if d.IsNewResource() { if err != nil {