variables.tf 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. variable "aws_region" {
  2. description = "AWS region."
  3. type = string
  4. }
  5. variable "environment" {
  6. description = "A name that identifies the environment, used as prefix and for tagging."
  7. type = string
  8. default = null
  9. validation {
  10. condition = var.environment == null
  11. error_message = "The \"environment\" variable is no longer used. To migrate, set the \"prefix\" variable to the original value of \"environment\" and optionally, add \"Environment\" to the \"tags\" variable map with the same value."
  12. }
  13. }
  14. variable "prefix" {
  15. description = "The prefix used for naming resources"
  16. type = string
  17. default = "github-actions"
  18. }
  19. variable "github_app_webhook_secret_arn" {
  20. type = string
  21. }
  22. variable "tags" {
  23. description = "Map of tags that will be added to created resources. By default resources will be tagged with name and environment."
  24. type = map(string)
  25. default = {}
  26. }
  27. variable "sqs_build_queue" {
  28. description = "SQS queue to publish accepted build events."
  29. type = object({
  30. id = string
  31. arn = string
  32. })
  33. }
  34. variable "lambda_zip" {
  35. description = "File location of the lambda zip file."
  36. type = string
  37. default = null
  38. }
  39. variable "lambda_timeout" {
  40. description = "Time out of the lambda in seconds."
  41. type = number
  42. default = 10
  43. }
  44. variable "role_permissions_boundary" {
  45. description = "Permissions boundary that will be added to the created role for the lambda."
  46. type = string
  47. default = null
  48. }
  49. variable "role_path" {
  50. description = "The path that will be added to the role; if not set, the environment name will be used."
  51. type = string
  52. default = null
  53. }
  54. variable "logging_retention_in_days" {
  55. description = "Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653."
  56. type = number
  57. default = 7
  58. }
  59. variable "logging_kms_key_id" {
  60. description = "Specifies the kms key id to encrypt the logs with"
  61. type = string
  62. default = null
  63. }
  64. variable "lambda_s3_bucket" {
  65. description = "S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly."
  66. default = null
  67. }
  68. variable "webhook_lambda_s3_key" {
  69. description = "S3 key for webhook lambda function. Required if using S3 bucket to specify lambdas."
  70. default = null
  71. }
  72. variable "webhook_lambda_s3_object_version" {
  73. description = "S3 object version for webhook lambda function. Useful if S3 versioning is enabled on source bucket."
  74. default = null
  75. }
  76. variable "repository_white_list" {
  77. description = "List of repositories allowed to use the github app"
  78. type = list(string)
  79. default = []
  80. }
  81. variable "kms_key_arn" {
  82. description = "Optional CMK Key ARN to be used for Parameter Store."
  83. type = string
  84. default = null
  85. }
  86. variable "runner_labels" {
  87. description = "Extra (custom) labels for the runners (GitHub). Separate each label by a comma. Labels checks on the webhook can be enforced by setting `enable_workflow_job_labels_check`. GitHub read-only labels should not be provided."
  88. type = string
  89. default = ""
  90. }
  91. variable "enable_workflow_job_labels_check" {
  92. description = "If set to true all labels in the workflow job even are matched agaist the custom labels and GitHub labels (os, architecture and `self-hosted`). When the labels are not matching the event is dropped at the webhook."
  93. type = bool
  94. default = false
  95. }
  96. variable "workflow_job_labels_check_all" {
  97. description = "If set to true all labels in the workflow job must match the GitHub labels (os, architecture and `self-hosted`). When false if __any__ label matches it will trigger the webhook. `enable_workflow_job_labels_check` must be true for this to take effect."
  98. type = bool
  99. default = true
  100. }
  101. variable "log_type" {
  102. description = "Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. "
  103. type = string
  104. default = "pretty"
  105. validation {
  106. condition = anytrue([
  107. var.log_type == "json",
  108. var.log_type == "pretty",
  109. var.log_type == "hidden",
  110. ])
  111. error_message = "`log_type` value not valid. Valid values are 'json', 'pretty', 'hidden'."
  112. }
  113. }
  114. variable "log_level" {
  115. description = "Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
  116. type = string
  117. default = "info"
  118. validation {
  119. condition = anytrue([
  120. var.log_level == "silly",
  121. var.log_level == "trace",
  122. var.log_level == "debug",
  123. var.log_level == "info",
  124. var.log_level == "warn",
  125. var.log_level == "error",
  126. var.log_level == "fatal",
  127. ])
  128. error_message = "`log_level` value not valid. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
  129. }
  130. }
  131. variable "disable_check_wokflow_job_labels" {
  132. description = "Disable the the check of workflow labels."
  133. type = bool
  134. default = false
  135. }
  136. variable "sqs_build_queue_fifo" {
  137. description = "Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners."
  138. type = bool
  139. default = false
  140. }
  141. variable "lambda_runtime" {
  142. description = "AWS Lambda runtime."
  143. type = string
  144. default = "nodejs16.x"
  145. }
  146. variable "lambda_architecture" {
  147. description = "AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86_64' functions. "
  148. type = string
  149. default = "x86_64"
  150. validation {
  151. condition = contains(["arm64", "x86_64"], var.lambda_architecture)
  152. error_message = "`lambda_architecture` value is not valid, valid values are: `arm64` and `x86_64`."
  153. }
  154. }