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

' azapi_resource ' resource does not support lifecycle meta argument #601

Closed
mukulkapoor01-new opened this issue Sep 2, 2024 · 3 comments

Comments

@mukulkapoor01-new
Copy link

A terraform apply is trying to destroy and re-create an existing Webapp in Azure because it detects a change in location, which is not the case. A lifecycle meta argument to ignore then changes in ' location ' could be useful in this scenario but ' azapi_resource ' does not support it.

Azapi version used: 1.15.0

image

@matt-FFFFFF
Copy link
Member

matt-FFFFFF commented Sep 4, 2024

I use azapi and it supports lifecycle meta argument:

see here

You should be able to ignore location changes like this:

resource "azapi_resource" "foo" {
  # ... other attributes
  lifecycle {
    ignore_changes = [location]
  }
}

Normally location is a top level attribute - are you trying to put it in the body?

@rmcolbert
Copy link

The "Microsoft.Web/sites/siteextensions" API doesn't support the top-level location attribute at all in the payload and it wasn't being used in the payload but the REST API response started injecting location (using full name, i.e. "East US 2" and not the shortname "eastus2").

Disabling built-in schema validation does allow the use of the ignore_changes = [location]

This feels like a backend management API issue that is bubbling up here but having location be a valid top level attribute on all API schemas (even if it gets thrown away internally) then we wouldn't need to disable schema validation.

@ms-henglu
Copy link
Member

I'll close this issue in favor of #655 which also includes other resource types that have same issue.

Please subscribe to #655 for any updates. Thanks.

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

4 participants