-
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
Declaring multiple ssl certificates in Application Gateway #2832
Comments
I've tried using a list of maps like so: http_listener = ["${var.https_listener_list}"]
ssl_certificate = ["${var.ssl_certificate_list}"]
request_routing_rule = ["${var.request_routing_rule_list}"] And declaring the inputs as lists in this manner: variable "https_listener_list" {
type = "list"
default = [
{
name = "https-listener-1"
frontend_ip_configuration_name = "feip"
frontend_port_name = "http-port"
protocol = "Https"
ssl_certificate_name = "ssl-certificate-1"
}
]
}
variable "ssl_certificate_list" {
type = "list"
default = [
{
name = "ssl-certificate-1"
data = "foo"
password = ""
}
]
}
variable "request_routing_rule_list" {
type = "list"
default = [
{
name = "j-rqrt-https"
rule_type = "Basic"
http_listener_name = "https-listener-1"
backend_address_pool_name = "beap"
backend_http_settings_name = "backendhttp"
}
]
} However when I'm trying to pass calculated values into the input it doesn't work: module "certificate" {
source = "../terraform-modules/azure/azure_ssl_certificate"
secret_name = "ahmed"
key_vault_name = "testvault"
}
module "application_gateway" {
source = "../terraform-modules/azure/azure_application_gateway"
resource_group_name = "${module.rg.resource_group_name}"
subnet_name = "${module.vnet.gateway_subnets[0]}"
backend_address_list = [
"192.168.1.10"
]
https_listener_list = [
{
name = "https-listener-1"
frontend_ip_configuration_name = "feip"
frontend_port_name = "http-port"
protocol = "Https"
ssl_certificate_name = "ssl-certificate-1"
}
]
ssl_certificate_list = [
{
name = "ssl-certificate-1"
data = "${module.certificate.secret_value}"
password = "${module.certificate.secret_passphrase}"
}
]
request_routing_rule_list = [
{
name = "j-rqrt-https"
rule_type = "Basic"
http_listener_name = "https-listener-1"
backend_address_pool_name = "beap"
backend_http_settings_name = "backendhttp"
}
]
} The expected result is a successful plan however I get the following error instead:
If I change Edit: My proposed method is hitting a limitation in terraform which is going to be solved in v0.12 (hashicorp/terraform#7034). It would be great to understand if there's another way to accomplish this. |
I've not tried anything with lists. I just do the following:
|
That works as you're declaring each one directly. I ended up having to just declare the application_gateway resource directly in the deployment and will have to revisit this when 0.12 is released. |
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! |
I'm a little confused on how to declare multiple SSL Certificates within the application gateway as I have to declare the certificates name within the https listener like so:
Do I need to declare multiple
https_listener
andssl_certificate
and give each a unique name? An example would be helpful as the resource documentation doesn't indicate how to achieve this.The text was updated successfully, but these errors were encountered: