diff --git a/internal/services/loganalytics/log_analytics_workspace_table_resource.go b/internal/services/loganalytics/log_analytics_workspace_table_resource.go index 235af840abed..b9217586252c 100644 --- a/internal/services/loganalytics/log_analytics_workspace_table_resource.go +++ b/internal/services/loganalytics/log_analytics_workspace_table_resource.go @@ -41,8 +41,8 @@ func (r LogAnalyticsWorkspaceTableResource) CustomizeDiff() sdk.ResourceFunc { rd := metadata.ResourceDiff if string(tables.TablePlanEnumBasic) == rd.Get("plan").(string) { - if _, ok := rd.GetOk("retention_in_days"); ok { - return fmt.Errorf("cannot set retention_in_days because the retention is fixed at eight days on Basic plan") + if v, ok := rd.GetOk("retention_in_days"); ok && v.(int) != 30 { + return fmt.Errorf("cannot set retention_in_days because the retention is fixed at 30 days on Basic plan") } } diff --git a/website/docs/r/log_analytics_workspace_table.html.markdown b/website/docs/r/log_analytics_workspace_table.html.markdown index bcf4fc9fff2b..f53bcec0bef2 100644 --- a/website/docs/r/log_analytics_workspace_table.html.markdown +++ b/website/docs/r/log_analytics_workspace_table.html.markdown @@ -46,7 +46,9 @@ The following arguments are supported: -> **Note:** The `name` of tables currently supported by the `Basic` plan can be found [here](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-azure-tables). -* `retention_in_days` - (Optional) The table's retention in days. Possible values are either `8` (Basic Tier only) or range between `4` and `730`. +* `retention_in_days` - (Optional) The table's retention in days. Possible values are between `4` and `730`. + +-> **Note:** The `retention_in_days` is fixed to `30` when `plan` is `Basic`. More details could be found [here](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-retention-configure?tabs=portal%2Cportal-1#analytics-long-term-and-total-retention). * `total_retention_in_days` - (Optional) The table's total retention in days. Possible values range between `4` and `730`; or `1095`, `1460`, `1826`, `2191`, `2556`, `2922`, `3288`, `3653`, `4018`, or `4383`.