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

Add 'output' to be allowed for ignore_changes #763

Open
DevopsMercenary opened this issue Feb 11, 2025 · 1 comment
Open

Add 'output' to be allowed for ignore_changes #763

DevopsMercenary opened this issue Feb 11, 2025 · 1 comment

Comments

@DevopsMercenary
Copy link

I was getting tired of terraform wanting to change the output on some azapi_resource that I have...

I added the ignore_changes to the azapi_resource

resource "azapi_resource" "daily-personal-scaling-plan" {

  type = "Microsoft.DesktopVirtualization/scalingPlans@2023-11-01-preview"

...


  lifecycle {
    ignore_changes = [
       tags, output
    ]
  }
}

This is terraform's response

Terraform will perform the following actions:

  # module.scaling-plan.azapi_resource.daily-personal-scaling-plan will be updated in-place
  ~ resource "azapi_resource" "daily-personal-scaling-plan" {
      ~ body                      = {
          ~ properties = {
              ~ exclusionTag       = "no-schedule" -> "no-avd-scaling"
                # (4 unchanged attributes hidden)
            }
        }
        id                        = "/subscription......."
        name                      = "c....."
      ~ output                    = {
          - id         = "........"
          - properties = {
              - hostPoolReferences = [
                  - {},
                ]
              - objectId           = "cae9bece-b576-4d0c-a61e-e97adbb1c194"
            }
          - type       = "Microsoft.DesktopVirtualization/scalingplans"
        } -> (known after apply)
        # (6 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
╷
│ Warning: Redundant ignore_changes element
│
│   on scaling-plan.tf line 4, in resource "azapi_resource" "daily-personal-scaling-plan":
│    4: resource "azapi_resource" "daily-personal-scaling-plan" {
│
│ Adding an attribute name to ignore_changes tells Terraform to ignore future
│ changes to the argument in configuration after the object has been created,
│ retaining the value originally configured.
│
│ The attribute output is decided by the provider alone and therefore there
│ can be no configured value to compare with. Including this attribute in
│ ignore_changes has no effect. Remove the attribute from ignore_changes to
│ quiet this warning.

It would be nice if the output could be ignored

@ms-henglu
Copy link
Member

Hi @DevopsMercenary ,

Thank you for taking time to report this issue.

You can use disable_default_output = true to disable the default output feature if you're not using the output.
https://registry.terraform.io/providers/Azure/azapi/latest/docs#disable_default_output-1

If the output is static, please see this workaround: #661 (comment)

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

No branches or pull requests

2 participants