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

APIM: behaviour of zones in additional_location differs from behaviour of zones in parent resource #26244

Closed
1 task done
CherylFlowers opened this issue Jun 5, 2024 · 4 comments · Fixed by #26384
Closed
1 task done

Comments

@CherylFlowers
Copy link

CherylFlowers commented Jun 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.3.8

AzureRM Provider Version

3.106.1

Affected Resource(s)/Data Source(s)

azurerm_api_management

Terraform Configuration Files

resource "azurerm_api_management" "api_management" {
  name                = "test"
  resource_group_name = "test-rg"
  location            = "canada central"  
  sku_name            = "Premium"
  publisher_name      = "test"
  publisher_email     = "[email protected]"
  zones               = ["1"]

  additional_location {
    location = "southeast asia"
    zones    = ["1", "2"]
  }
}

Debug Output/Panic Output

+ additional_location {
+ capacity             = (known after apply)
+ gateway_disabled     = false
+ gateway_regional_url = (known after apply)
+ location             = "southeastasia"
+ private_ip_addresses = (known after apply)
+ public_ip_addresses  = (known after apply)
+ zones                = [
+ "1",
+ "2",
] # forces replacement
}

Expected Behaviour

When adding a brand new additional_location to an existing APIM instance, the zones argument should not trigger a replacement, regardless of the value.

Actual Behaviour

When adding a brand new additional_location to an existing APIM instance, if the zones field is configured, it triggers a replacement of the APIM instance. If the zones field is omitted, it does not trigger a replacement.

Steps to Reproduce

  1. Provision an APIM instance with no additional_location.
  2. Add additional_location and omit the zones argument.
  3. Run a terraform plan and note that the plan does not force a replacement of the APIM instance.
  4. Add the zones field to additional_location.
  5. Run a terraform plan and note that the plan now forces a replacement of the APIM instance.

Important Factoids

No response

References

It appears this pull request may be related to this unexpected behaviour. It appears that the functionality of the zones argument was updated for the APIM instance itself, but the same changes were not made to the additional_location argument.

@sinbai
Copy link
Contributor

sinbai commented Jun 14, 2024

Hi @CherylFlowers thanks for opening this issue. Per the Terraform documentation below, changing zone of additional_locationforces a new resource to be created. I assume that the symptom is expected. Is it possible to explain why this case should not trigger a replacement?

image

@klakshmikantha
Copy link

Hi @sinbai - Thank you for the response. Changing or setting the zones under 'additional_location' should re-create the data plane resource deployed in that region but not the entire control plane of APIM which is what is happening now. The zones at root level for control plane should drive recreation of the control plane but not the zones under each additional location block.
This is especially important as we add additional data planes in the future spanning geographies but can't afford to re-create control plane risking the configurations/APIs/products etc. already setup and also not impact other region data planes.
The zone setting under the additional_location block should only re-create the data plane in that location.

@sinbai
Copy link
Contributor

sinbai commented Jun 19, 2024

Hi @klakshmikantha thanks for your reply. PR has been submitted to remove the replacement when the zone in additional_location changes. Could you please track it for more updates?

@github-actions github-actions bot added this to the v3.110.0 milestone Jun 26, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Jul 27, 2024
@rcskosir rcskosir added the bug label Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants