-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 resource not honoring lifecycle ignore_changes for ssl_certificates during apply #6330
Comments
Another way to explain this perhaps is that there are required arguments as of azurerm module 2.2.0+ which are restricting us. In 2.2.0 and 2.3.0 empty passwords for ssl certificates were not accepted in addition to lifecycle ignore_changes not being respected. Seeing this error which seems to be correlated with the issue reported here. Error: Error expanding myagw.tf line 20, in resource "azurerm_application_gateway" "myagw": ... ssl_certificate { Perhaps related to this fix in 2.2.0: #3935 |
@darrenk13 were you able to find a work around the error somehow? |
No, I have not found a work around for this issue. There looks to be a couple of other issues around ssl certs and application gateways:
I wonder this and those two issues are related. |
FWIW I can still repro this issue with Any chance to get an ETA for addressing this issue? It's currently blocking us from upgrading our environment using TF; any info about potential release dates would help us with planning. |
It would be great if an update could be shared on this topic (is anyone working on it, do we have an ETA,...). Unfortunately this is really blocking us from updating our Azure infra using TF. |
@alecor191 @darrenk13 did you find any workaround for that issue? or is there another solution? |
@finkj unfortunately not. We're still stuck. |
@alecor191 i destroyed my existing infra and created a new one. solved the problem. |
@darrenk13 unfortunately we run into the same problem with a really similar setup. AKS, Azure App Gateway and AGIC within the Kubernetes Cluster... We are using following versions:
Have you found a valid workaround or are there any updates? |
@darrenk13 @alecor191 @gitflo1 I have a workaround for this. I altered the code in expandApplicationGatewaySslCertificates to check for a pre-existing public cert and not error out during expansion if the cert exists but the password / data don't exist. Then I compiled the provider and baked it into the docker image that we do our builds in. Here's the updated code: func expandApplicationGatewaySslCertificates(d *schema.ResourceData) (*[]network.ApplicationGatewaySslCertificate, error) {
vs := d.Get("ssl_certificate").([]interface{})
results := make([]network.ApplicationGatewaySslCertificate, 0)
for _, raw := range vs {
v := raw.(map[string]interface{})
name := v["name"].(string)
data := v["data"].(string)
password := v["password"].(string)
kvsid := v["key_vault_secret_id"].(string)
cert := v["public_cert_data"].(string)
output := network.ApplicationGatewaySslCertificate{
Name: utils.String(name),
ApplicationGatewaySslCertificatePropertiesFormat: &network.ApplicationGatewaySslCertificatePropertiesFormat{},
}
// nolint gocritic
if data != "" && kvsid != "" {
return nil, fmt.Errorf("only one of `key_vault_secret_id` or `data` must be specified for the `ssl_certificate` block %q", name)
} else if data != "" {
// data must be base64 encoded
output.ApplicationGatewaySslCertificatePropertiesFormat.Data = utils.String(utils.Base64EncodeIfNot(data))
output.ApplicationGatewaySslCertificatePropertiesFormat.Password = utils.String(password)
} else if kvsid != "" {
if password != "" {
return nil, fmt.Errorf("only one of `key_vault_secret_id` or `password` must be specified for the `ssl_certificate` block %q", name)
}
output.ApplicationGatewaySslCertificatePropertiesFormat.KeyVaultSecretID = utils.String(kvsid)
} else if cert != "" {
output.ApplicationGatewaySslCertificatePropertiesFormat.PublicCertData = utils.String(cert)
} else {
return nil, fmt.Errorf("either `key_vault_secret_id` or `data` must be specified for the `ssl_certificate` block %q", name)
}
results = append(results, output)
}
return &results, nil
} Hope this helps. I might PR into the main repo soon. |
Stuck as well with same error an usage. Any update please ? |
Hello @ztbrown Do you think you can do the PR ? Thx in advance |
@Adel-E @trotman23 @rrey @ztbrown @gitflo1 @darrenk13 @mbfrahry @katbyte I create MR with @ztbrown fix. Can you take a look, please? It is #8761 |
Looking forward to the provided fix #8761 to be merged. |
Closing based on merge of linked PR. |
This has been released in version 2.33.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 = "~> 2.33.0"
}
# ... other configuration ... |
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 👉 [email protected]. Thanks! |
Community Note
Terraform v0.12.18
Tested with the following additional versions of azurerm:
v2.2.0 -> affected
v2.1.0 -> not affected
Affected Resource(s)
azurerm_application_gateway
Terraform Configuration Files
Expected Behavior
Terraform should have applied the changes to the application gateway and ignore the ssl certificate configuration.
Actual Behavior
Terraform did not change the settings to the application gateway and outputted the following error:
Steps to Reproduce
terraform plan
. No pending changes (expected, good)terraform plan
. Only pending change is autoscale_configuration (expected, good)terraform apply
. Receive an error like above (not expected)Important Factoids
We are using an application gateway to route traffic to an AKS cluster. As part of this we use the Application Gateway Ingress Controller in the kubernetes cluster. The AGIC will update the Application Gateway independent of Terraform so we have many fields set to ignore changes in the lifecycle block of the application gateway resource. T
References
The text was updated successfully, but these errors were encountered: