main.tf 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. locals {
  2. api_hostname = var.api_hostname != "" ? var.api_hostname : "api.${var.hostname}"
  3. proxy_hostname = var.proxy_hostname != "" ? var.proxy_hostname : "proxy.${var.hostname}"
  4. api_shield_region = var.api_shield_region != "" ? var.api_shield_region : var.shield_region
  5. proxy_shield_region = var.proxy_shield_region != "" ? var.proxy_shield_region : var.shield_region
  6. }
  7. module "app" {
  8. source = "./modules/app"
  9. name = var.name
  10. hostname = var.hostname
  11. default_ttl = var.default_ttl
  12. backend_name = var.backend_name
  13. ssl_hostname = var.ssl_hostname
  14. backend_address = var.backend_address
  15. backend_port = var.backend_port
  16. shield_region = var.shield_region
  17. healthcheck_host = var.healthcheck_host
  18. healthcheck_name = var.healthcheck_name
  19. healthcheck_path = var.healthcheck_path
  20. healthcheck_method = var.healthcheck_method
  21. healthcheck_expected_response = var.healthcheck_expected_response
  22. force_tls_hsts = var.force_tls_hsts
  23. hsts_duration = var.hsts_duration
  24. gzip_default_policy = var.gzip_default_policy
  25. product_enablement = var.product_enablement
  26. datadog = var.datadog
  27. datadog_region = var.datadog_region
  28. datadog_service = var.datadog_service
  29. datadog_token = var.datadog_token
  30. }
  31. module "api" {
  32. source = "./modules/api"
  33. name = var.api_name
  34. hostname = local.api_hostname
  35. default_ttl = var.api_default_ttl
  36. backend_name = var.api_backend_name
  37. ssl_hostname = var.api_ssl_hostname
  38. backend_address = var.api_backend_address
  39. backend_port = var.api_backend_port
  40. backend_ca_cert = var.api_backend_ca_cert
  41. shield_region = local.api_shield_region
  42. healthcheck_host = var.api_healthcheck_host
  43. healthcheck_name = var.api_healthcheck_name
  44. healthcheck_path = var.api_healthcheck_path
  45. healthcheck_method = var.api_healthcheck_method
  46. healthcheck_expected_response = var.api_healthcheck_expected_response
  47. force_tls_hsts = var.api_force_tls_hsts
  48. hsts_duration = var.api_hsts_duration
  49. datadog = var.api_datadog
  50. datadog_region = var.datadog_region
  51. datadog_service = var.api_datadog_service
  52. datadog_token = var.datadog_token
  53. }
  54. module "proxy" {
  55. source = "./modules/proxy"
  56. name = var.proxy_name
  57. hostname = local.proxy_hostname
  58. default_ttl = var.proxy_default_ttl
  59. backend_name = var.proxy_backend_name
  60. ssl_hostname = var.proxy_ssl_hostname
  61. backend_address = var.proxy_backend_address
  62. backend_port = var.backend_port
  63. shield_region = local.proxy_shield_region
  64. healthcheck_host = var.proxy_healthcheck_host
  65. healthcheck_name = var.proxy_healthcheck_name
  66. healthcheck_path = var.proxy_healthcheck_path
  67. healthcheck_method = var.proxy_healthcheck_method
  68. healthcheck_expected_response = var.proxy_healthcheck_expected_response
  69. force_tls_hsts = var.proxy_force_tls_hsts
  70. hsts_duration = var.proxy_hsts_duration
  71. datadog = var.proxy_datadog
  72. datadog_region = var.datadog_region
  73. datadog_service = var.proxy_datadog_service
  74. datadog_token = var.datadog_token
  75. }