-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
post upgrade to azurerm 3.10.0, Azurerm application gateway updating in a place and create as a new #17315
Comments
Even if roll back to previous azureRM version, for some resources it says that have been created by upgraded version. thus upgrade your azureRM version. this is also one of reason cant roll back. So as we were running in older version, would like to continue to new one. |
Hi @arpitmishra-eaton thank you for opening this issue here. Since no terraform configuration file was provided, I tried to reproduce this issue with the following tf configuration. Unfortunately, I could not repro it. Could you repro with the following tf config and steps? Could you provide your tf config and repro steps to help repro and troubleshooting? Step1: Create an azurerm_application_gateway with the following tf config (Terraform v1.1.5 and AzureRM Provider v3.6.0 ):
Step2: Upgrade Terraform from v1.1.5 to V1.2.2 and AzureRM Provider from v3.6.0 to v3.10.0. |
Could you provide your terraform configuration to help repro and troubleshooting? Besides, what are the previous Terraform and AzureRM version? |
even now i tried with tf version 1.2.3(latest) and ARMVersion 3.10.0 but no luck. terraform init -upgrade -no-color -backend-config=storage_account_name=$TARGET_RS_STORAGE_ACCOUNT -backend-config=container_name=$TARGET_RS_CONTAINER_NAME -backend-config=key=$TARGET_ENV -backend-config=resource_group_name=$TARGET_RS_RG -backend-config=access_key=$TARGET_RS_STORAGE_ACCESS_KEY and performed terraform plan.... and saw that public IP is re-creating which is linked to application gateway so many conf is getting removed in it and updating its place. attached the same snapshot above. Please check |
Please let me know if you need anything.. |
Could you please provide the full tf configuration via text instead of screenshot? If I can reproduce it easily, troubleshooting might be faster. |
resource "azurerm_public_ip" "agwip" {
} resource "azurerm_application_gateway" "resiot-agw" {
Below are for customer site
Listener for app service live site https
} |
Please check. it is the agw conf and public ip conf. |
Hi @arpitmishra-eaton, you said your public IP got recreated... Isn't your problem similar as I had when I upgraded AzureRM to version 3.8.0? Before upgrade my resource "azurerm_public_ip" hadn't defined the "zones" in the tf configuration and automatically got assigned [1,2,3] - I checked this via Azure Portal. But after AzureRM upgrade to 3.8.0 the terraform wanted to recreate the resource "azurerm_public_ip" due to mismatch at "zones" attribute like depicted below: -/+ resource "azurerm_public_ip" "appgwip" {
~ fqdn = "***"
~ id = "***"
~ ip_address = "***"
- ip_tags = {} -> null
name = "***"
tags = {}
- zones = [
- "1",
- "2",
- "3",
] -> null # forces replacement
# (8 unchanged attributes hidden)
} I fixed this by adding the zones = [1, 2, 3] into my tf code in resource "azurerm_public_ip" and terraform stopped wanting to recreate the public ip. |
Per the Data Resource Dependencies, could you please replace the "data.azurerm_key_vault_certificate.agw-cert.secret_id" with a local variable try again? Also, could you please provide the output of "terraform plan", so we can see what caused the application gateway to rebuild even though the public ip didn't rebuild? |
@sinbai i have also noticed in tf file we have config probe in application gateway like below probe { and what we got terraform plan like below ... so presuming could be cause to re-create it.
|
in azure portal, match {} is created |
Do you mean you already know what caused the application gateway to be recreated? |
yes.. just like public ip is recreating because there was Zones missing in ".tf file" hence, was recreating. So, i'm assuming this could be same case for application gateway. so checking and reporting back. |
Congratulations! Are you okey if we close this issue? |
No @sinbai i'm still checking.. not sure if that assumption would work. just reporting in 3-5 mins |
seems, there is diff issue. still application gateway health probes are re-creating. |
terraform Plan: 2022-06-27T06:14:20.3711134Z Terraform used the selected roviders to generate the following execution |
@arpitmishra-eaton as in your plan above - "Plan: 1 to add, 27 to change, 0 to destroy." there is no re-create. This is known issue on application gateway and is here for very long time. And I think everybody struggles with this update issue on application gateway attributes when your tf plan looks terrifying and shows the change on multiple attributes even though there is no change in configuration. You can read about it more here #6896 (comment). |
Hi @eissko, we're facing the same issue with app gateway public ip zones addition while updating azurerm version. Before upgrade, my resource "azurerm_public_ip" hadn't defined the "zones" in the tf configuration and automatically got assigned [1,2,3] - like you we also checked this via Azure Portal. After AzureRM upgrade to 3.14.0 from 2.99.0 terraform wanted to recreate the resource "azurerm_public_ip" due to mismatch at "zones" attribute like depicted below:
|
@fsocietyinc so you fix should be easy. add to your terraform code the zones definition zones = ["1", "2", "3"]. And the plan should be without recreate now. |
@eissko Did you create any github issue for this bug with azurerm? |
Is there an existing issue for this?
Community Note
Terraform Version
1.2.2
AzureRM Provider Version
3.10.0
Affected Resource(s)/Data Source(s)
azurerm_application_gateway
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
it should not be creating a new resources and use as it is.
Actual Behaviour
creating as a new resources probably.
Steps to Reproduce
upgraded to new azureRM version and terraform version
terraform plan and apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: