diff --git a/internal/services/network/public_ip_resource.go b/internal/services/network/public_ip_resource.go index 36105472d8a2..8bbf927af5ce 100644 --- a/internal/services/network/public_ip_resource.go +++ b/internal/services/network/public_ip_resource.go @@ -337,12 +337,14 @@ func resourcePublicIpRead(d *pluginsdk.ResourceData, meta interface{}) error { d.Set("domain_name_label", settings.DomainNameLabel) } + ddosProtectionMode := string(network.DdosSettingsProtectionModeVirtualNetworkInherited) if ddosSetting := props.DdosSettings; ddosSetting != nil { - d.Set("ddos_protection_mode", string(ddosSetting.ProtectionMode)) + ddosProtectionMode = string(ddosSetting.ProtectionMode) if subResource := ddosSetting.DdosProtectionPlan; subResource != nil { d.Set("ddos_protection_plan_id", subResource.ID) } } + d.Set("ddos_protection_mode", ddosProtectionMode) d.Set("ip_tags", flattenPublicIpPropsIpTags(props.IPTags))