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

fix(management): azapi_resource.diag_settings #1027

Merged

Conversation

Laudenlaruto
Copy link
Contributor

Overview/Summary

Fixes a regression in 6.0.0

This PR fixes/adds/changes/removes

  1. Invalid configuration when upgrading to v6.0.0 #1024

Testing Evidence

Tested in locally and it works.

As part of this Pull Request I have

  • Checked for duplicate Pull Requests
  • Associated it with relevant issues, for tracking and closure.
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Updated relevant and associated documentation.

@Laudenlaruto
Copy link
Contributor Author

Laudenlaruto commented Jul 10, 2024

It works but when updating it, it want to recreate the resource.

  # azapi_resource.diag_settings["/providers/Microsoft.Management/managementGroups/xxx-sandboxes"] must be replaced
-/+ resource "azapi_resource" "diag_settings" {
      ~ id                        = "/providers/Microsoft.Management/managementGroups/xxx-sandboxes/providers/Microsoft.Insights/diagnosticSettings/toLA" -> (known after apply)
      - location                  = "global" -> null # forces replacement
        name                      = "toLA"
      ~ output                    = jsonencode({}) -> (known after apply)
        # (7 unchanged attributes hidden)
    }

I think we need to update the provider to 1.14.0

@Laudenlaruto Laudenlaruto force-pushed the fix/azapi_resource.diag_settings branch from a76e672 to fdd5df2 Compare July 10, 2024 18:27
@Laudenlaruto
Copy link
Contributor Author

It works when I added schema_validation_enabled = false

@qaiserali
Copy link

schema_validation_enabled

I don't think it is good idea to set schema_validation_enabled to false.

@Laudenlaruto Laudenlaruto force-pushed the fix/azapi_resource.diag_settings branch from fdd5df2 to 0f4f940 Compare July 12, 2024 13:05
@Laudenlaruto
Copy link
Contributor Author

Needed to change
location = "global"
otherwise It wants to replace it everytime I apply
~ location = "global" -> "francecentral" # forces replacement

@matt-FFFFFF
Copy link
Member

Thank you for your PR! Will run through the tests

@matt-FFFFFF
Copy link
Member

/azp run unit

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@matt-FFFFFF matt-FFFFFF merged commit daad162 into Azure:main Jul 12, 2024
9 checks passed
@Laudenlaruto Laudenlaruto deleted the fix/azapi_resource.diag_settings branch July 13, 2024 15:49
@qaiserali
Copy link

@matt-FFFFFF When are you planning to merge this with v6.0.0?

@qaiserali
Copy link

I can confirm that this is still an issue with v6.1.0

It still wants to replace when run the tf apply command

~ location = "global" -> "null" # forces replacement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants