2024-03-04 11:15:34 +08:00
|
|
|
variable "name" {
|
|
|
|
type = string
|
|
|
|
description = "Name of apigateway"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "description" {
|
|
|
|
type = string
|
|
|
|
description = "Description of apigateway"
|
|
|
|
}
|
|
|
|
|
2024-03-05 11:50:02 +08:00
|
|
|
variable "apigw-type" {
|
2024-03-04 11:15:34 +08:00
|
|
|
type = string
|
2024-03-05 11:50:02 +08:00
|
|
|
description = "Type of apigateway: private or regional"
|
|
|
|
validation {
|
|
|
|
condition = can(regex("^(private|regional)$", var.apigw-type))
|
|
|
|
error_message = "Invalid apigw type, only allowed types are: 'private', 'regional'"
|
|
|
|
}
|
2024-03-04 11:15:34 +08:00
|
|
|
}
|
|
|
|
|
2024-03-05 11:50:02 +08:00
|
|
|
variable "resources" {
|
2024-03-05 12:16:56 +08:00
|
|
|
type = map(object({
|
|
|
|
method = string
|
|
|
|
authorization = string
|
|
|
|
integration_type = string
|
|
|
|
content_handling = string
|
|
|
|
}))
|
2024-03-05 11:50:02 +08:00
|
|
|
description = "Apigateway resources (path_part)"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "stages" {
|
2024-03-05 12:16:56 +08:00
|
|
|
type = map(object({
|
|
|
|
description = string
|
|
|
|
variables = map(string)
|
|
|
|
}))
|
2024-03-04 14:12:59 +08:00
|
|
|
description = "apigateway stages"
|
2024-03-04 11:15:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "lambda-archive-file" {
|
|
|
|
type = string
|
|
|
|
description = "Path to lambda zip archive"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "lambda-runtime-version" {
|
|
|
|
type = string
|
|
|
|
description = "Lambda runtime version"
|
|
|
|
default = "python3.12"
|
|
|
|
}
|
|
|
|
|
2024-03-04 11:35:37 +08:00
|
|
|
variable "lambda-main-function-name" {
|
|
|
|
type = string
|
2024-03-04 11:15:34 +08:00
|
|
|
description = "Main python file without the .py extension"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "apigw-vpc-id" {
|
|
|
|
type = string
|
|
|
|
description = "VPC id of apigateway"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "apigw-subnet-ids" {
|
|
|
|
type = list(string)
|
|
|
|
description = "Subnet IDs of apigateway"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "apigw-security-group-id" {
|
|
|
|
type = string
|
|
|
|
description = "Security group id of apigateway"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "create-vpc-link" {
|
|
|
|
type = bool
|
|
|
|
description = "Set true to create vpc link for outbound access to specific targets"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "apigw-vpc-link-target-arns" {
|
|
|
|
type = list(string)
|
|
|
|
description = "Target arns for apigateway VPC link"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "cloudwatchlog-retention" {
|
|
|
|
type = number
|
|
|
|
description = "Cloudwatch log group retention days"
|
|
|
|
default = 14
|
2024-03-04 11:35:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "cwl-cmk-key-id" {
|
|
|
|
type = string
|
|
|
|
description = "CMK arn for cloudwatch logs encryption"
|
|
|
|
default = null
|
2024-03-04 11:15:34 +08:00
|
|
|
}
|