variables.tf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # =======================================
  2. # IPsec Security Gateway (SGW) deployment
  3. # Input variables
  4. # =======================================
  5. # =================
  6. # Global parameters
  7. # =================
  8. variable "cloud_id" {
  9. description = "YC cloud-id. Taken from environment variable."
  10. }
  11. variable "folder_id" {
  12. description = "YC folder-id. Taken from environment variable."
  13. }
  14. variable "ipsec_policy" {
  15. description = "IPsec parameters for both sides"
  16. type = object(
  17. {
  18. policy_name = string
  19. ike_proposal = string
  20. esp_proposal = string
  21. psk = string
  22. })
  23. default = {
  24. policy_name = null
  25. ike_proposal = null
  26. esp_proposal = null
  27. psk = null
  28. }
  29. }
  30. # =================================
  31. # Yandex Cloud side: strongSwan SGW
  32. # =================================
  33. variable "yc_sgw" {
  34. description = "YC IPsec SGW"
  35. type = object(
  36. {
  37. name = string
  38. folder_name = string
  39. image_folder_id = string
  40. image_name = string
  41. zone = string
  42. subnet = string
  43. inside_ip = string
  44. admin_name = string
  45. admin_key_path = string
  46. })
  47. default = {
  48. name = null
  49. folder_name = null
  50. image_folder_id = "standard-images"
  51. image_name = null
  52. zone = null
  53. subnet = null
  54. inside_ip = null
  55. admin_name = null
  56. admin_key_path = null
  57. }
  58. }
  59. variable "yc_subnets" {
  60. description = "YC IP subnet prefixes"
  61. type = object(
  62. {
  63. net_name = string
  64. prefix_list = list(string)
  65. rt_name = string
  66. rt_internet_access = bool
  67. force_subnets_update = bool
  68. })
  69. default = {
  70. net_name = null
  71. prefix_list = null
  72. rt_name = null
  73. rt_internet_access = false
  74. force_subnets_update = false
  75. }
  76. }
  77. # =================================
  78. # Remote side: 3rd party IPsec SGW
  79. # =================================
  80. variable "remote_sgw" {
  81. description = "Remote IPsec Security Gateway (SGW)"
  82. type = object(
  83. {
  84. name = string
  85. type = string
  86. outside_ip = string
  87. })
  88. default = {
  89. name = null
  90. type = "unknown"
  91. outside_ip = null
  92. }
  93. validation {
  94. condition = contains([
  95. "unknown",
  96. "cisco-iosxe",
  97. "cisco-asa",
  98. "mikrotik-chr"
  99. ], lower(var.remote_sgw.type)
  100. )
  101. error_message = "Only few SGW types are supported. See variables.tf for details."
  102. }
  103. }
  104. variable "remote_subnets" {
  105. description = "Yandex Cloud Subnet prefixes list"
  106. type = list(string)
  107. default = null
  108. }
  109. variable "labels" {
  110. description = "A set of key/value label pairs to assign."
  111. type = map(string)
  112. default = null
  113. }