Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_log_analytics_workspace_table support for total_retention_in_days property #24513

Merged
merged 5 commits into from Feb 9, 2024

Conversation

vanny96
Copy link
Contributor

@vanny96 vanny96 commented Jan 16, 2024

As of now, the azurerm_log_analytics_workspace_table resource only allows to set the retention_in_days field for its tables

resource "azurerm_log_analytics_workspace_table" "example" {
  workspace_id      = azurerm_log_analytics_workspace.example.id
  name              = "AppMetrics"
  retention_in_days = 60
}

With this PR the goal is to be able to set also a total_retention_in_days using the same logic used for retention_in_days.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @vanny96. Could you please add a test for this new property as well as update the docs?

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a test failure here:

Test ended in panic.

------- Stdout: -------
=== RUN   TestAccLogAnalyticsWorkspaceTable_plan
=== PAUSE TestAccLogAnalyticsWorkspaceTable_plan
=== CONT  TestAccLogAnalyticsWorkspaceTable_plan

------- Stderr: -------
panic: Invalid address to set: []string{"total_retention_in_datys"}

goroutine 531 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc000b3ed80, {0x7c90bf5, 0x18}, {0x7ce8600, 0xf409ee0})
	/opt/teamcity-agent/work/3337027aeff310bf/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:233 +0x2b5
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.ResourceMetaData.Encode({0xc0020a2000, {0x9771c98, 0xc0029b0858}, 0xc000b3ed80, 0x0, {0x9771cd0, 0xf4bb220}}, {0x7a1d340, 0xc0049d5180})
	/opt/teamcity-agent/work/3337027aeff310bf/internal/sdk/resource_encode.go:31 +0x247
github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics.(*LogAnalyticsWorkspaceTableResource).Read.LogAnalyticsWorkspaceTableResource.Read.func1({0x9770d80, 0xc0028c0f50}, {0xc0020a2000, {0x9771c98, 0xc0029b0858}, 0xc000b3ed80, 0x0, {0x9771cd0, 0xf4bb220}})
	/opt/teamcity-agent/work/3337027aeff310bf/internal/services/loganalytics/log_analytics_workspace_table_resource.go:241 +0x55b
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func2({0x9770d80, 0xc0028c0f50}, 0x0?, {0x7efaf60?, 0xc0020a2000?})
	/opt/teamcity-agent/work/3337027aeff310bf/internal/sdk/wrapper_resource.go:62 +0x1c8

@vanny96
Copy link
Contributor Author

vanny96 commented Feb 2, 2024

Sorry for that, I'll try to debug it a bit! Thank you for your patience!

@katbyte katbyte changed the title Adds TotalRetentionInDays to azurerm_log_analytics_workspace_table azurerm_log_analytics_workspace_table support for total_retention_in_days property Feb 9, 2024
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vanny96 - LGTM 🎢

@katbyte katbyte merged commit f528cee into hashicorp:main Feb 9, 2024
33 checks passed
katbyte added a commit that referenced this pull request Feb 9, 2024
@github-actions github-actions bot added this to the v3.91.0 milestone Feb 9, 2024
lemeurherve pushed a commit to jenkins-infra/azure that referenced this pull request Feb 9, 2024
<Actions>
<action
id="f410411e63aff4bb73a81c2aec1d373cf8a903e63b30dee2006b0030d8a94cc8">
        <h3>Bump Terraform `azurerm` provider version</h3>
<details
id="1d9343c012f5434ac9fe8a98135bae3667b399259be16d9b14302ea3bd424a24">
            <summary>Update Terraform lock file</summary>
<p>changes detected:&#xA;&#x9;&#34;hashicorp/azurerm&#34; updated from
&#34;3.90.0&#34; to &#34;3.91.0&#34; in file
&#34;.terraform.lock.hcl&#34;</p>
            <details>
                <summary>3.91.0</summary>
<pre>Changelog retrieved
from:&#xA;&#x9;https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.91.0&#xA;FEATURES:&#xA;&#xA;*
**New Data Source**: `azurerm_databricks_access_connector`
([#24769](https://github.com/hashicorp/terraform-provider-azurerm/issues/24769))&#xA;*
**New Resource**:
`azurerm_data_protection_backup_policy_kubernetes_cluster`
([#24718](https://github.com/hashicorp/terraform-provider-azurerm/issues/24718))&#xA;*
**New Resource**: `azurerm_chaos_studio_experiment`
([#24779](https://github.com/hashicorp/terraform-provider-azurerm/issues/24779))&#xA;*
**New Resource**: `azurerm_chaos_studio_capability`
([#24779](https://github.com/hashicorp/terraform-provider-azurerm/issues/24779))&#xA;*
**New Resource**: `azurerm_dev_center_gallery`
([#23760](https://github.com/hashicorp/terraform-provider-azurerm/issues/23760))&#xA;*
**New Resource:** `azurerm_kubernetes_fleet_member`
([#24792](https://github.com/hashicorp/terraform-provider-azurerm/issues/24792))&#xA;*
**New Resource:** `azurerm_iotcentral_organization`
([#23132](https://github.com/hashicorp/terraform-provider-azurerm/issues/23132))&#xA;*
**New Resource:**
`azurerm_spring_cloud_app_dynamics_application_performance_monitoring`
([#24750](https://github.com/hashicorp/terraform-provider-azurerm/issues/24750))&#xA;&#xA;ENHANCEMENTS:&#xA;&#xA;*
dependencies: updating to `v0.20240208.1095436` of
`github.com/hashicorp/go-azure-sdk/resource-manager`
([#24819](https://github.com/hashicorp/terraform-provider-azurerm/issues/24819))&#xA;*
dependencies: updating to `v0.20240208.1095436` of
`github.com/hashicorp/go-azure-sdk/sdk`
([#24819](https://github.com/hashicorp/terraform-provider-azurerm/issues/24819))&#xA;*
dependencies: refactor `azurerm_app_service_environment_v3` to use
`go-azure-sdk`
([#24760](https://github.com/hashicorp/terraform-provider-azurerm/issues/24760))&#xA;*
dependencies: refactor `azurerm_role_definition` to use `go-azure-sdk`
([#24266](https://github.com/hashicorp/terraform-provider-azurerm/issues/24266))&#xA;*
`managedhsm`: updating to use the transport layer from
`hashicorp/go-azure-sdk` rather than `Azure/go-autorest`
([#24761](https://github.com/hashicorp/terraform-provider-azurerm/issues/24761))&#xA;*
`hdinsight`: updating to API Version `2023-07-01`
([#24761](https://github.com/hashicorp/terraform-provider-azurerm/issues/24761))&#xA;*
`streamanalytics`: updating to use the transport layer from
`hashicorp/go-azure-sdk` rather than `Azure/go-autorest`
([#24819](https://github.com/hashicorp/terraform-provider-azurerm/issues/24819))&#xA;*
`azurerm_app_service_environment_v3` - support for the
`remote_debugging_enabled` property
([#24760](https://github.com/hashicorp/terraform-provider-azurerm/issues/24760))&#xA;*
`azurerm_storage_account` - support for the `local_user_enabled`
property
([#24800](https://github.com/hashicorp/terraform-provider-azurerm/issues/24800))&#xA;*
`azurerm_log_analytics_workspace_table` - support for the
`total_retention_in_days` property
([#24513](https://github.com/hashicorp/terraform-provider-azurerm/issues/24513))&#xA;*
`azurerm_maching_learning_workspace` - support for the `feature_store`
and `kind` properties
([#24716](https://github.com/hashicorp/terraform-provider-azurerm/issues/24716))&#xA;*
`azurerm_traffic_manager_azure_endpoint` - support for the
`always_serve_enabled` property
([#24573](https://github.com/hashicorp/terraform-provider-azurerm/issues/24573))&#xA;*
`azurerm_traffic_manager_external_endpoint` - support for the
`always_serve_enabled` property
([#24573](https://github.com/hashicorp/terraform-provider-azurerm/issues/24573))&#xA;&#xA;BUG
FIXES:&#xA;&#xA;* `azurerm_api_management` - the
`virtual_network_configuration` property now updates correctly outside
of `virtual_network_type`
([#24569](https://github.com/hashicorp/terraform-provider-azurerm/issues/24569))&#xA;&#xA;&#xA;</pre>
            </details>
        </details>
<a
href="https://infra.ci.jenkins.io/job/terraform-jobs/job/azure/job/main/1083/">Jenkins
pipeline link</a>
    </action>
</Actions>

---

<table>
  <tr>
    <td width="77">
<img src="https://www.updatecli.io/images/updatecli.png" alt="Updatecli
logo" width="50" height="50">
    </td>
    <td>
      <p>
Created automatically by <a
href="https://www.updatecli.io/">Updatecli</a>
      </p>
      <details><summary>Options:</summary>
        <br />
<p>Most of Updatecli configuration is done via <a
href="https://www.updatecli.io/docs/prologue/quick-start/">its
manifest(s)</a>.</p>
        <ul>
<li>If you close this pull request, Updatecli will automatically reopen
it, the next time it runs.</li>
<li>If you close this pull request and delete the base branch, Updatecli
will automatically recreate it, erasing all previous commits made.</li>
        </ul>
        <p>
Feel free to report any issues at <a
href="https://github.com/updatecli/updatecli/issues">github.com/updatecli/updatecli</a>.<br
/>
If you find this tool useful, do not hesitate to star <a
href="https://github.com/updatecli/updatecli/stargazers">our GitHub
repository</a> as a sign of appreciation, and/or to tell us directly on
our <a
href="https://matrix.to/#/#Updatecli_community:gitter.im">chat</a>!
        </p>
      </details>
    </td>
  </tr>
</table>

Co-authored-by: Jenkins Infra Bot (updatecli) <60776566+jenkins-infra-bot@users.noreply.github.com>
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 29, 2024
…days property (hashicorp#24513)

* Adds TotalRetentionInDays to azurerm_log_analytics_workspace_table

* Adds test coverage and documentation

* Fixes typo in total_retention_in_days

* Update internal/services/loganalytics/log_analytics_workspace_table_resource_test.go

* Update internal/services/loganalytics/log_analytics_workspace_table_resource_test.go

---------

Co-authored-by: Giovanni Barbaro <vanni-96@hotmail.it>
Co-authored-by: kt <kt@katbyte.me>
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this pull request Feb 29, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants