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

Application Gateway: fixing the permanent AGW tf update problem (fqdns) #3085

Merged
merged 4 commits into from
Mar 21, 2019
Merged

Application Gateway: fixing the permanent AGW tf update problem (fqdns) #3085

merged 4 commits into from
Mar 21, 2019

Conversation

andrey-dubnik
Copy link
Contributor

@andrey-dubnik andrey-dubnik commented Mar 20, 2019

fixes: #2894

There is AGW issue when updating the configuration as TF populates the backend pool based on the computed values of fqdns and fqdn_list producing following state

"backend_address_pool.0.fqdn_list.#": "1", "backend_address_pool.0.fqdn_list.0": "wapazewtmlit-dnr-cm-tst1.azurewebsites.net", "backend_address_pool.0.fqdns.#": "1", "backend_address_pool.0.fqdns.0": "wapazewtmlit-dnr-cm-tst1.azurewebsites.net",

Where up on read values and populate both new and deprecated elements with identical values

`
flattenApplicationGatewayBackendAddressPools

        output := map[string]interface{}{
            "fqdns": fqdnList,
            "ip_addresses": ipAddressList,

            // TODO: deprecated - remove in 2.0
            "ip_address_list": ipAddressList,
            "fqdn_list": fqdnList,
        }
`

Because of this expandApplicationGatewayBackendAddressPools produces duplicates when AGW is updated because values only get duplicated by Read post GW creation.

PR only going into backendAddresses filling for the _list values when there are no fqdns and ip_addresses handled which is need to handle create (otherwise deprecated part could have been removed).

@ghost ghost added the size/S label Mar 20, 2019
@ghost ghost added size/XL and removed size/S labels Mar 20, 2019
@ghost ghost added size/XS and removed size/XL labels Mar 20, 2019
@andrey-dubnik andrey-dubnik changed the title Adubnik fqdns fix Application Gateway: fixing the permanent AGW tf update problem (fqdns) Mar 20, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @adam-resdiary, LGTM provided tests pass 👍

@katbyte katbyte added this to the v1.24.0 milestone Mar 21, 2019
@katbyte katbyte merged commit 2e27dc5 into hashicorp:master Mar 21, 2019
katbyte added a commit that referenced this pull request Mar 21, 2019
@adam-resdiary
Copy link
Contributor

@katbyte thanks for the thank you, although I think it's @adubnik who deserves the praise 😸

@andrey-dubnik andrey-dubnik deleted the adubnik-fqdns-fix branch March 22, 2019 22:58
@Mobe1969
Copy link

Mobe1969 commented Apr 3, 2019

Is there likely to be a new version of the azurerm provider module issues with this in? The module hasn't had a release since this was addressed.

@ghost
Copy link

ghost commented Apr 3, 2019

This has been released in version 1.24.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.24.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 20, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating azurerm_application_gateway fails with Duplicate address error
4 participants