Skip to content

Commit

Permalink
Added necessary cloud run parameters to the main module
Browse files Browse the repository at this point in the history
  • Loading branch information
vedit committed Aug 10, 2024
1 parent 3c1a5b4 commit 45cf2da
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/secure-cloud-run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ module "cloud_run_core" {
max_scale_instances = var.max_scale_instances
volumes = var.volumes
ssl_certificates = var.ssl_certificates
container_concurrency = var.container_concurrency
timeout_seconds = var.timeout_seconds
limits = var.limits
requests = var.requests
ports = var.ports
argument = var.argument
container_command = var.container_command
volume_mounts = var.volume_mounts

depends_on = [
module.serverless_project_apis,
Expand Down
61 changes: 61 additions & 0 deletions modules/secure-cloud-run/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,64 @@ variable "ssl_certificates" {
}
description = "A object with a list of domains to auto-generate SSL certificates or a list of SSL Certificates self-links in the pattern `projects/<PROJECT-ID>/global/sslCertificates/<CERT-NAME>` to be used by Load Balancer."
}

// template spec
variable "container_concurrency" {
description = "Concurrent request limits to the service."
type = number
default = null
}

variable "timeout_seconds" {
description = "Timeout for each request."
type = number
default = 120
}

# template spec container
# resources
# cpu = (core count * 1000)m
# memory = (size) in Mi/Gi
variable "limits" {
description = "Resource limits to the container."
type = map(string)
default = null
}
variable "requests" {
description = "Resource requests to the container."
type = map(string)
default = {}
}

variable "ports" {
description = "Port which the container listens to (http1 or h2c)."
type = object({
name = string
port = number
})
default = {
name = "http1"
port = 8080
}
}

variable "argument" {
description = "Arguments passed to the ENTRYPOINT command, include these only if image entrypoint needs arguments."
type = list(string)
default = []
}

variable "container_command" {
description = "Leave blank to use the ENTRYPOINT command defined in the container image, include these only if image entrypoint should be overwritten."
type = list(string)
default = []
}

variable "volume_mounts" {
type = list(object({
mount_path = string
name = string
}))
description = "[Beta] Volume Mounts to be attached to the container (when using secret)."
default = []
}

0 comments on commit 45cf2da

Please sign in to comment.