{"action":"opened","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1542","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1542/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1542/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1542/events","html_url":"https://github.com/terraform-providers/terraform-provider-azurerm/issues/1542","id":340347358,"node_id":"MDU6SXNzdWUzNDAzNDczNTg=","number":1542,"title":"Conditionals for application gateway backend pools","user":{"login":"PleaseStopAsking","id":35308946,"node_id":"MDQ6VXNlcjM1MzA4OTQ2","avatar_url":"https://avatars1.githubusercontent.com/u/35308946?v=4","gravatar_id":"","url":"https://api.github.com/users/PleaseStopAsking","html_url":"https://github.com/PleaseStopAsking","followers_url":"https://api.github.com/users/PleaseStopAsking/followers","following_url":"https://api.github.com/users/PleaseStopAsking/following{/other_user}","gists_url":"https://api.github.com/users/PleaseStopAsking/gists{/gist_id}","starred_url":"https://api.github.com/users/PleaseStopAsking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PleaseStopAsking/subscriptions","organizations_url":"https://api.github.com/users/PleaseStopAsking/orgs","repos_url":"https://api.github.com/users/PleaseStopAsking/repos","events_url":"https://api.github.com/users/PleaseStopAsking/events{/privacy}","received_events_url":"https://api.github.com/users/PleaseStopAsking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-11T18:01:35Z","updated_at":"2018-07-11T18:01:35Z","closed_at":null,"author_association":"NONE","body":"<!--- Please keep this note for the community --->\r\n\r\n### Community Note\r\n\r\n* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request\r\n* Please do not leave \"+1\" or \"me too\" comments, they generate extra noise for issue followers and do not help prioritize the request\r\n* If you are interested in working on this issue or have submitted a pull request, please leave a comment\r\n\r\n<!--- Thank you for keeping this note for the community --->\r\n\r\n### Description\r\n\r\nIt would be helpful if there was a way to conditionally create certain arguments when using the application gateway resource. Specifically, I would like to be able to create additional ```backend_address_pool```, ```probe```, ```backend_http_settings ``` and ```path_rule``` based on a true/false variable that I am also using to conditionally deploy extra servers behind the application gateway.\r\n\r\n### New or Affected Resource(s)\r\n\r\nazurerm_application_gateway\r\n\r\n### Potential Terraform Configuration\r\n```hcl\r\nresource \"azurerm_application_gateway\" \"appGateway\" {\r\n ...\r\n\r\n  backend_address_pool {\r\n    count = \"${var.deployInfo[\"enableExtraServers\"] == \"true\" ? 1 : 0}\"\r\n    name = \"${var.extraServers[\"name\"]}\"\r\n    ip_address_list = [\"${var.extraServers[\"ip_address_list\"]}\"]\r\n  }\r\n\r\n  probe {\r\n    count = \"${var.deployInfo[\"enableExtraServers\"] == \"true\" ? 1 : 0}\"\r\n    name = \"${var.extraServers[\"name\"]}\"\r\n    protocol = \"Https\"\r\n    path = \"${var.extraServers[\"healthCheckPath\"]}\"\r\n    host = \"127.0.0.1\"\r\n    interval  = 30\r\n    timeout = 30\r\n    unhealthy_threshold = 3\r\n  }\r\n\r\n  backend_http_settings {\r\n    count = \"${var.deployInfo[\"enableExtraServers\"] == \"true\" ? 1 : 0}\"\r\n    name = \"${var.extraServers[\"name\"]}\"\r\n    cookie_based_affinity = \"Disabled\"\r\n    port = 443\r\n    protocol = \"Https\"\r\n    request_timeout = 20\r\n    probe_name = \"${var.extraServers[\"name\"]}\"\r\n    }\r\n  }\r\n\r\n  url_path_map {\r\n    ...\r\n\r\n    path_rule {\r\n      count = \"${var.deployInfo[\"enableExtraServers\"] == \"true\" ? 1 : 0}\"\r\n      name = \"${var.extraServers[\"name\"]}\"\r\n      backend_address_pool_name = \"${var.extraServers[\"name\"]}\"\r\n      backend_http_settings_name = \"${var.extraServers[\"name\"]}\"\r\n      paths = [\"/${var.extraServers[\"path\"]}/*\"]\r\n    }\r\n  }\r\n}\r\n```\r\n### References"}}
{"actor":{"display_login":"PleaseStopAsking"}}