Skip to content

Upgrade deleteWorkspaces API version to 2023-09-01#29283

Merged
sreallymatt merged 1 commit intohashicorp:mainfrom
s4heid:deletedworkspaces-api-version
Apr 11, 2025
Merged

Upgrade deleteWorkspaces API version to 2023-09-01#29283
sreallymatt merged 1 commit intohashicorp:mainfrom
s4heid:deletedworkspaces-api-version

Conversation

@s4heid
Copy link
Contributor

@s4heid s4heid commented Apr 7, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This change upgrades the deleteWorkspaces API version to 2023-09-01.

The current API version 2022-10-01 does not support AzureChinaCloud or AzureUSGovernment clouds since commit 3479e73 introduced an API call to list the deleted workspaces when creating a new loganalytics workspace.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

To validate my Pull Request, I have tried to create an azurerm_log_analytics_workspace on an AzureChinaCloud subscription with and without my changes. See the output below.

Using v4.26.0
❯ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

# azurerm_log_analytics_workspace.example will be created

  • resource "azurerm_log_analytics_workspace" "example" {
    • allow_resource_only_permissions = true
    • daily_quota_gb = -1
    • id = (known after apply)
    • internet_ingestion_enabled = true
    • internet_query_enabled = true
    • local_authentication_disabled = false
    • location = "chinanorth3"
    • name = "example-log-analytics-workspace"
    • primary_shared_key = (sensitive value)
    • resource_group_name = "rg-sh-test-terraform"
    • retention_in_days = 30
    • secondary_shared_key = (sensitive value)
    • sku = "PerGB2018"
    • workspace_id = (known after apply)
      }

# azurerm_resource_group.example will be created

  • resource "azurerm_resource_group" "example" {
    • id = (known after apply)
    • location = "chinanorth3"
    • name = "rg-sh-test-terraform"
      }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

azurerm_resource_group.example: Creating...
azurerm_resource_group.example: Still creating... [10s elapsed]
azurerm_resource_group.example: Creation complete after 11s [id=/subscriptions/redacted/resourceGroups/rg-sh-test-terraform]
azurerm_log_analytics_workspace.example: Creating...

│ Error: listing deleted Log Analytics Workspaces: unexpected status 404 (404 Not Found) with error: InvalidResourceType: The resource type 'deletedWorkspaces' could not be found in the namespace 'Microsoft.OperationalInsights' for api version '2022-10-01'. The supported api-versions are '2020-03-01-preview,2020-08-01,2020-10-01,2021-12-01-preview,2023-09-01'.

│ with azurerm_log_analytics_workspace.example,
│ on example.tf line 19, in resource "azurerm_log_analytics_workspace" "example":
│ 19: resource "azurerm_log_analytics_workspace" "example" {


Using refs/heads/deletedworkspaces-api-version
❯ terraform apply
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - hashicorp/azurerm in /workspaces/dev-terraform-provider/build/terraform/terraform-azurerm
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
azurerm_resource_group.example: Refreshing state... [id=/subscriptions/redacted/resourceGroups/rg-sh-test-terraform]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

# azurerm_log_analytics_workspace.example will be created

  • resource "azurerm_log_analytics_workspace" "example" {
    • allow_resource_only_permissions = true
    • daily_quota_gb = -1
    • id = (known after apply)
    • internet_ingestion_enabled = true
    • internet_query_enabled = true
    • local_authentication_disabled = false
    • location = "chinanorth3"
    • name = "example-log-analytics-workspace"
    • primary_shared_key = (sensitive value)
    • resource_group_name = "rg-sh-test-terraform"
    • retention_in_days = 30
    • secondary_shared_key = (sensitive value)
    • sku = "PerGB2018"
    • workspace_id = (known after apply)
      }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

azurerm_log_analytics_workspace.example: Creating...
azurerm_log_analytics_workspace.example: Still creating... [10s elapsed]
azurerm_log_analytics_workspace.example: Still creating... [20s elapsed]
azurerm_log_analytics_workspace.example: Still creating... [30s elapsed]
azurerm_log_analytics_workspace.example: Creation complete after 35s [id=/subscriptions/redacted/resourceGroups/rg-sh-test-terraform/providers/Microsoft.OperationalInsights/workspaces/example-log-analytics-workspace]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_log_analytics_workspace - support in AzureChinaCloud and AzureUSGovernment clouds.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@s4heid s4heid force-pushed the deletedworkspaces-api-version branch from 02b6ca4 to 471af7c Compare April 7, 2025 13:26
Copy link
Collaborator

@sreallymatt sreallymatt left a comment

Choose a reason for hiding this comment

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

Thanks @s4heid, unfortunately we don't have access to AzureChinaCloud or AzureUSGovernment to test there.

I have run the tests for this in our subscription and since there are no new failures introduced because of this change this LGTM.

image

@sreallymatt sreallymatt merged commit ad96741 into hashicorp:main Apr 11, 2025
30 checks passed
@github-actions github-actions bot added this to the v4.27.0 milestone Apr 11, 2025
sreallymatt added a commit that referenced this pull request Apr 11, 2025
@s4heid s4heid deleted the deletedworkspaces-api-version branch April 14, 2025 09:07
jackofallops added a commit that referenced this pull request Apr 25, 2025
* Update CHANGELOG.md #29285, #29294

* Update CHANGELOG.md for #29307

* Update CHANGELOG.md #29283

* Update CHANGELOG.md #29271

* Update CHANGELOG.md #29298

* Update CHANGELOG.md #29278

* Update CHANGELOG.md #29341

* Update CHANGELOG.md #29328

* Update CHANGELOG.md #29292

* Update CHANGELOG.md #29361

* Update CHANGELOG.md #29296

* Update CHANGELOG.md #28239

* Update CHANGELOG.md #28974

* Update CHANGELOG.md #29254

* Update CHANGELOG.md #29333

* Update CHANGELOG.md #29314

* Update CHANGELOG.md #28929

* Update CHANGELOG.md for #29382

* Update for #28676

* Update CHANGELOG.md for #28740

* Update CHANGELOG.md for #28559

* Update CHANGELOG.md #29143

* Update CHANGELOG.md #29329

* Update CHANGELOG.md #29380

* Update CHANGELOG.md #29309

* Update CHANGELOG.md #29317

* prep for release

---------

Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: kt <kt@katbyte.me>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: jackofallops <ste@hashicorp.com>
teowa pushed a commit to teowa/terraform-provider-azurerm that referenced this pull request May 8, 2025
teowa pushed a commit to teowa/terraform-provider-azurerm that referenced this pull request May 8, 2025
* Update CHANGELOG.md hashicorp#29285, hashicorp#29294

* Update CHANGELOG.md for hashicorp#29307

* Update CHANGELOG.md hashicorp#29283

* Update CHANGELOG.md hashicorp#29271

* Update CHANGELOG.md hashicorp#29298

* Update CHANGELOG.md hashicorp#29278

* Update CHANGELOG.md hashicorp#29341

* Update CHANGELOG.md hashicorp#29328

* Update CHANGELOG.md hashicorp#29292

* Update CHANGELOG.md hashicorp#29361

* Update CHANGELOG.md hashicorp#29296

* Update CHANGELOG.md hashicorp#28239

* Update CHANGELOG.md hashicorp#28974

* Update CHANGELOG.md hashicorp#29254

* Update CHANGELOG.md hashicorp#29333

* Update CHANGELOG.md hashicorp#29314

* Update CHANGELOG.md hashicorp#28929

* Update CHANGELOG.md for hashicorp#29382

* Update for hashicorp#28676

* Update CHANGELOG.md for hashicorp#28740

* Update CHANGELOG.md for hashicorp#28559

* Update CHANGELOG.md hashicorp#29143

* Update CHANGELOG.md hashicorp#29329

* Update CHANGELOG.md hashicorp#29380

* Update CHANGELOG.md hashicorp#29309

* Update CHANGELOG.md hashicorp#29317

* prep for release

---------

Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: kt <kt@katbyte.me>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: jackofallops <ste@hashicorp.com>
@github-actions
Copy link
Contributor

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 May 15, 2025
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.

2 participants