azurerm_log_analytics_workspace_table Allow deploying of DCR based custom log tables#27155
azurerm_log_analytics_workspace_table Allow deploying of DCR based custom log tables#27155oWretch wants to merge 6 commits intohashicorp:mainfrom
azurerm_log_analytics_workspace_table Allow deploying of DCR based custom log tables#27155Conversation
|
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
f95d113 to
6e50d44
Compare
|
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
|
@oWretch can you fix the linting errors and rebase? Maybe we can get this branch finally merged 🙏 |
|
Thanks for the review @nclaeys. As per the PR description, the reason for the linting error is:
If we are happy to accept the plan diff for existing managed resource I can remove the |
6c5b34b to
c087b2c
Compare
|
@katbyte @stephybun can you have a look? I really need this feature to be added to the provider and it has been out there without feedback for months. I want to help where needed to get this merged. |
|
If I understood correctly, this PR closes: |
|
Any update on this? |
|
Thanks for the review @wyattfry. Updates made as requested. |
| check.That("azurerm_log_analytics_workspace_table.test").Key("id").Exists(), | ||
| check.That("azurerm_log_analytics_workspace_table.test").Key("name").HasValue("AppEvents"), | ||
| check.That("azurerm_log_analytics_workspace_table.test").Key("retention_in_days").HasValue("7"), |
There was a problem hiding this comment.
Here and further down the explicit check.That(...)s can be omitted as the test automatically will fail if there's a difference between configuration and the resulting resource.
| check.That("azurerm_log_analytics_workspace_table.test").Key("id").Exists(), | |
| check.That("azurerm_log_analytics_workspace_table.test").Key("name").HasValue("AppEvents"), | |
| check.That("azurerm_log_analytics_workspace_table.test").Key("retention_in_days").HasValue("7"), |
|
Thanks for your patience and work on this so far. I had a couple questions:
|
|
Thanks @wyattfry. There is no hard requirement for a single resource - I extended the existing resource initially to prevent duplicating extra code. The new table formats have come subsequently, so I'm happy to change track and move to separate resources. It would also solve the 5.0 upgrade differences. |
In that case, let's go with the separate resources approach. I'd be happy to take some of them! |
|
I have a draft PR started for the Microsoft type table: #30663 |
|
Thanks @wyattfry. I'll try to get to the custom log resource - life is busy at present so it might be a couple of weeks. |
Community Note
Description
Enable the creation of DCR-based custom log tables in a Log Analytics workspace.
This PR will break the existing initial workflow of auto-importing a default Microsoft table when changing the retention policy. Instead of auto-importing, the resource will now return an ImportRequired error instead, forcing the inbuilt table to be imported.
To prevent further breakage, I have defined a default for the
typeproperty to beMicrosoft, though this will cause a drift for any tables that were managed and not a Microsoft table. I have also defined thesub_typeto be both Optional and Computed rather than creating a default to again uplift the existing usage of the resource where possible.I had hoped to get this in before the release of v4.0, but just missed it. So I have conditioned the
typeandsub_typeproperties as Optional for 4.0 and Required for 5.0.PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_log_analytics_workspace_table- allow creating new DCR-based custom log tables [azurerm_log_analytics_workspace_tableAllow deploying of DCR based custom log tables #27155]This is a (please select all that apply):
Related Issue(s)
Fixes #21897
Fixes #23359
Note
If this PR changes meaningfully during the course of review please update the title and description as required.