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

bug: ignore diagnostics settings categories that are not enabled #706

Open
kewalaka opened this issue Jan 4, 2025 · 2 comments
Open

bug: ignore diagnostics settings categories that are not enabled #706

kewalaka opened this issue Jan 4, 2025 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@kewalaka
Copy link

kewalaka commented Jan 4, 2025

When setting diagnostic settings, any that are not enabled should be removed from the items returned.

e.g. for a storage account, if you set "StorageDelete" and "StorageWrite", on subsequent plans you will see this:

  ~ resource "azapi_resource" "diagnostic_settings" {
      ~ body                      = {
          ~ properties = {
              ~ logs                        = [
                    {
                        category      = "StorageDelete"
                        categoryGroup = null
                        enabled       = true
                    },
                  - {
                      - category      = "StorageRead"
                      - categoryGroup = null
                      - enabled       = false
                    },
                    {
                        category      = "StorageWrite"
                        categoryGroup = null
                        enabled       = true
                    },
                ]
                # (7 unchanged attributes hidden)
@ms-henglu ms-henglu added the enhancement New feature or request label Jan 6, 2025
@ms-henglu
Copy link
Member

Hi @kewalaka ,

Thank you for taking time to report this issue.

The azapi_resource is a generic resource to manage all azure resources, so it uses an universal way to compare between configuration and remote states, for example, there's no customized logic to remove the disabled settings from the diagnostic settings.

But I think we could improve this in the future, by introducing a machniesm to suppress the difference when the array returns not-configured items.

@stemaMSFT
Copy link
Member

@ms-henglu this isn't a top priority ask, but it does seem like a nice QoL improvement.

@ms-henglu ms-henglu added this to the Backlog milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants