variables.tf 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ### Name convertion
  2. variable "usernames_to_ids" {
  3. description = "If true Usernames from IAM and Federation will be used as input variables 'iam_users_names' and 'fed_users_names'"
  4. type = bool
  5. default = true
  6. }
  7. variable "federation_id" {
  8. description = "Federation ID, mandatory for 'fed_users_names'"
  9. type = string
  10. default = null
  11. }
  12. ###Folder
  13. variable "folder_id" {
  14. default = null
  15. type = string
  16. description = "Folder-ID where need to add permissions. Mandatory variable for FOLDER, if omited default FOLDER_ID will be used"
  17. }
  18. variable "folder_binding_authoritative" {
  19. type = bool
  20. default = false
  21. description = "Authoritative. Sets the IAM policy for the FOLDER and replaces any **existing** policy already attached."
  22. }
  23. variable "folder_user_role_mapping" {
  24. default = []
  25. type = any
  26. description = <<EOT
  27. Group of IAM User-IDs and it's permissions in FOLDER, where name = JOB Tille(aka IAM Group). Use usernames or user-ids or both
  28. ### Example
  29. #folder_user_role_mapping = [
  30. {
  31. job_title_name = "devops"
  32. iam_users_names = ["name.surname", ]
  33. fed_users_names = ["name.surname@yantoso.ru", ]
  34. roles = ["iam.serviceAccounts.user", "k8s.editor", "k8s.cluster-api.cluster-admin", "container-registry.admin"]
  35. },
  36. {
  37. job_title_name = "developers"
  38. users_with_ids = ["userAccount:idxxxxxx1", "federatedUser:idxxxxxx2"]
  39. roles = ["k8s.viewer",]
  40. },
  41. ]
  42. EOT
  43. }
  44. variable "sa_role_mapping" {
  45. default = []
  46. type = any
  47. description = <<EOT
  48. List of SA and it's permissions
  49. ### Example
  50. sa_role_mapping = [
  51. {
  52. name = "sa-cluster"
  53. roles = ["editor",]
  54. },
  55. {
  56. name = "sa-nodes"
  57. roles = ["container-registry.images.puller",]
  58. },
  59. ]
  60. EOT
  61. }
  62. ### Cloud
  63. variable "cloud_binding_authoritative" {
  64. type = bool
  65. default = false
  66. description = <<EOT
  67. "Authoritative. Sets the IAM policy for the CLOUD and replaces any **existing** policy already attached.
  68. If Authoritative = true : take roles from all objects in variable "cloud_user_role_mapping" and make **unique** role as a new key of map with members"
  69. EOT
  70. }
  71. variable "cloud_id" {
  72. type = string
  73. default = null
  74. description = "Cloud-ID where where need to add permissions. Mandatory variable for CLOUD, if omited default CLOUD_ID will be used"
  75. }
  76. variable "cloud_user_role_mapping" {
  77. default = []
  78. type = any
  79. description = <<EOT
  80. Group of IAM User-IDs and it's permissions in CLOUD, where name = JOB Tille(aka IAM Group). Use usernames or user-ids or both
  81. ### Example
  82. #cloud_user_role_mapping = [
  83. {
  84. job_title_name = "devops"
  85. iam_users_names = ["name.surname", ]
  86. fed_users_names = ["name.surname@yantoso.ru", ]
  87. roles = ["editor", ]
  88. },
  89. {
  90. job_title_name = "developers"
  91. users_with_ids = ["userAccount:idxxxxxx1", "federatedUser:idxxxxxx2"]
  92. iam_users_names = ["name.surname", ]
  93. roles = ["viewer","k8s.editor",]
  94. },
  95. ]
  96. EOT
  97. }
  98. ### Organization-manager
  99. variable "org_binding_authoritative" {
  100. type = bool
  101. default = false
  102. description = <<EOT
  103. "Authoritative. Sets the IAM policy for the ORGANIZATION and replaces any **existing** policy already attached.
  104. If Authoritative = true : take roles from all objects in variable "org_user_role_mapping" and make **unique** role as a new key of map with members"
  105. EOT
  106. }
  107. variable "org_id" {
  108. type = string
  109. default = null
  110. description = "ORGANIZATION-ID where where need to add permissions. Mandatory variable for ORGANIZATION, if omited default ORGANIZATION_ID will be used"
  111. }
  112. variable "org_user_role_mapping" {
  113. default = []
  114. type = any
  115. description = <<EOT
  116. Group of IAM User-IDs and it's permissions in ORGANIZATION, where name = JOB Tille(aka IAM Group). Use usernames or user-ids or both
  117. ### Example
  118. #org_user_role_mapping = [
  119. {
  120. job_title_name = "admins"
  121. iam_users_names = ["name.surname", ]
  122. fed_users_names = ["name.surname@yantoso.ru", ]
  123. roles = ["admin",]
  124. },
  125. {
  126. job_title_name = "network_admins"
  127. users_with_ids = ["userAccount:idxxxxxx1", "federatedUser:idxxxxxx2"]
  128. roles = ["vpc.admin",]
  129. },
  130. ]
  131. EOT
  132. }