Skip to content

Commit

Permalink
Adds test coverage and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vanny96 committed Feb 1, 2024
1 parent d7ec6c6 commit 62a03b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func TestAccLogAnalyticsWorkspaceTable_updateTableRetention(t *testing.T) {
check.That(data.ResourceName).Key("id").Exists(),
check.That(data.ResourceName).Key("name").HasValue("AppEvents"),
check.That(data.ResourceName).Key("retention_in_days").HasValue("7"),
check.That(data.ResourceName).Key("total_retention_in_days").HasValue("20"),
),
},
})
Expand Down Expand Up @@ -79,9 +80,10 @@ resource "azurerm_log_analytics_workspace" "test" {
retention_in_days = 30
}
resource "azurerm_log_analytics_workspace_table" "test" {
name = "AppEvents"
workspace_id = azurerm_log_analytics_workspace.test.id
retention_in_days = 7
name = "AppEvents"
workspace_id = azurerm_log_analytics_workspace.test.id
retention_in_days = 7
total_retention_in_days = 20
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger)
}
Expand Down
13 changes: 9 additions & 4 deletions website/docs/r/log_analytics_workspace_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ resource "azurerm_log_analytics_workspace" "example" {
retention_in_days = 30
}
resource "azurerm_log_analytics_workspace_table" "example" {
workspace_id = azurerm_log_analytics_workspace.example.id
name = "AppMetrics"
retention_in_days = 60
workspace_id = azurerm_log_analytics_workspace.example.id
name = "AppMetrics"
retention_in_days = 60
total_retention_in_days = 180
}
```

Expand All @@ -47,7 +48,9 @@ The following arguments are supported:

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

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

-> **Note:** The `retention_in_days` cannot be specified when `plan` is `Basic` because the retention is fixed at eight days.

Expand All @@ -61,6 +64,8 @@ The following attributes are exported:

* `retention_in_days` - The table's data retention in days.

* `total_retention_in_days` - The table's total data retention in days.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
Expand Down

0 comments on commit 62a03b7

Please sign in to comment.