Skip to content

Commit

Permalink
update retention_days validation (#27053)
Browse files Browse the repository at this point in the history
  • Loading branch information
teowa authored Aug 19, 2024
1 parent 25812bc commit 8733b58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

type LogAnalyticsWorkspaceTableResource struct {
}
type LogAnalyticsWorkspaceTableResource struct{}

var _ sdk.ResourceWithUpdate = LogAnalyticsWorkspaceTableResource{}
var _ sdk.ResourceWithCustomizeDiff = LogAnalyticsWorkspaceTableResource{}
var (
_ sdk.ResourceWithUpdate = LogAnalyticsWorkspaceTableResource{}
_ sdk.ResourceWithCustomizeDiff = LogAnalyticsWorkspaceTableResource{}
)

type LogAnalyticsWorkspaceTableResourceModel struct {
Name string `tfschema:"name"`
Expand Down Expand Up @@ -76,13 +77,13 @@ func (r LogAnalyticsWorkspaceTableResource) Arguments() map[string]*pluginsdk.Sc
"retention_in_days": {
Type: pluginsdk.TypeInt,
Optional: true,
ValidateFunc: validation.Any(validation.IntBetween(30, 730), validation.IntInSlice([]int{7})),
ValidateFunc: validation.IntBetween(4, 730),
},

"total_retention_in_days": {
Type: pluginsdk.TypeInt,
Optional: true,
ValidateFunc: validation.Any(validation.IntBetween(30, 4383), validation.IntInSlice([]int{7})),
ValidateFunc: validation.Any(validation.IntBetween(4, 730), validation.IntInSlice([]int{1095, 1460, 1826, 2191, 2556, 2922, 3288, 3653, 4018, 4383})),
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/log_analytics_workspace_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +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-configure?tabs=portal-1#supported-tables).

* `retention_in_days` - (Optional) The table's retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
* `retention_in_days` - (Optional) The table's retention in days. Possible values are either `8` (Basic Tier only) or range between `4` and `730`.

* `total_retention_in_days` - (Optional) The table's total retention in days. Possible values range between 30 and 4383.
* `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`.

-> **Note:** `retention_in_days` and `total_retention_in_days` will revert back to the value of azurerm_log_analytics_workspace retention_in_days when a azurerm_log_analytics_workspace_table is deleted.

Expand Down

0 comments on commit 8733b58

Please sign in to comment.