123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- variable "aws_region" {
- description = "AWS region."
- type = string
- }
- variable "environment" {
- description = "A name that identifies the environment, used as prefix and for tagging."
- type = string
- default = null
- validation {
- condition = var.environment == null
- 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."
- }
- }
- variable "prefix" {
- description = "The prefix used for naming resources"
- type = string
- default = "github-actions"
- }
- variable "github_app_webhook_secret_arn" {
- type = string
- }
- variable "tags" {
- description = "Map of tags that will be added to created resources. By default resources will be tagged with name and environment."
- type = map(string)
- default = {}
- }
- variable "sqs_build_queue" {
- description = "SQS queue to publish accepted build events."
- type = object({
- id = string
- arn = string
- })
- }
- variable "lambda_zip" {
- description = "File location of the lambda zip file."
- type = string
- default = null
- }
- variable "lambda_timeout" {
- description = "Time out of the lambda in seconds."
- type = number
- default = 10
- }
- variable "role_permissions_boundary" {
- description = "Permissions boundary that will be added to the created role for the lambda."
- type = string
- default = null
- }
- variable "role_path" {
- description = "The path that will be added to the role; if not set, the environment name will be used."
- type = string
- default = null
- }
- variable "logging_retention_in_days" {
- 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."
- type = number
- default = 7
- }
- variable "logging_kms_key_id" {
- description = "Specifies the kms key id to encrypt the logs with"
- type = string
- default = null
- }
- variable "lambda_s3_bucket" {
- description = "S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly."
- default = null
- }
- variable "webhook_lambda_s3_key" {
- description = "S3 key for webhook lambda function. Required if using S3 bucket to specify lambdas."
- default = null
- }
- variable "webhook_lambda_s3_object_version" {
- description = "S3 object version for webhook lambda function. Useful if S3 versioning is enabled on source bucket."
- default = null
- }
- variable "repository_white_list" {
- description = "List of repositories allowed to use the github app"
- type = list(string)
- default = []
- }
- variable "kms_key_arn" {
- description = "Optional CMK Key ARN to be used for Parameter Store."
- type = string
- default = null
- }
- variable "runner_labels" {
- 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."
- type = string
- default = ""
- }
- variable "enable_workflow_job_labels_check" {
- 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."
- type = bool
- default = false
- }
- variable "workflow_job_labels_check_all" {
- 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."
- type = bool
- default = true
- }
- variable "log_type" {
- description = "Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. "
- type = string
- default = "pretty"
- validation {
- condition = anytrue([
- var.log_type == "json",
- var.log_type == "pretty",
- var.log_type == "hidden",
- ])
- error_message = "`log_type` value not valid. Valid values are 'json', 'pretty', 'hidden'."
- }
- }
- variable "log_level" {
- description = "Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
- type = string
- default = "info"
- validation {
- condition = anytrue([
- var.log_level == "silly",
- var.log_level == "trace",
- var.log_level == "debug",
- var.log_level == "info",
- var.log_level == "warn",
- var.log_level == "error",
- var.log_level == "fatal",
- ])
- error_message = "`log_level` value not valid. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
- }
- }
- variable "disable_check_wokflow_job_labels" {
- description = "Disable the the check of workflow labels."
- type = bool
- default = false
- }
- variable "sqs_build_queue_fifo" {
- description = "Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners."
- type = bool
- default = false
- }
- variable "lambda_runtime" {
- description = "AWS Lambda runtime."
- type = string
- default = "nodejs16.x"
- }
- variable "lambda_architecture" {
- description = "AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86_64' functions. "
- type = string
- default = "x86_64"
- validation {
- condition = contains(["arm64", "x86_64"], var.lambda_architecture)
- error_message = "`lambda_architecture` value is not valid, valid values are: `arm64` and `x86_64`."
- }
- }
|