Skip to content

Commit

Permalink
Add features to container module (#135)
Browse files Browse the repository at this point in the history
* add more features

* Commit changes made by code formatters

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
georgepstaylor and github-actions[bot] authored Apr 29, 2024
1 parent a895b0d commit 5006b11
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
16 changes: 14 additions & 2 deletions container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ locals {
logConfiguration = var.log_configuration,
secrets = var.secrets,
environment = var.environment
healthCheck = var.health_check
systemControls = var.system_controls
command = var.command
startTimeout = var.start_timeout
stopTimeout = var.stop_timeout
entryPoint = var.entry_point
linuxParameters = var.linux_parameters
}
container_definition_json = jsonencode(local.container_definition)
container_definition_list = jsonencode([local.container_definition])

filtered_container_definition = {
for key, value in local.container_definition : key => value if value != null
}

container_definition_json = jsonencode(local.filtered_container_definition)
container_definition_list = jsonencode([local.filtered_container_definition])
}
59 changes: 59 additions & 0 deletions container/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ variable "port_mappings" {
variable "cpu" {
description = "The number of cpu units to reserve for the container"
type = number
default = null
}

variable "memory" {
description = "The amount of memory (in MiB) to reserve for the container"
type = number
default = null
}

variable "essential" {
Expand Down Expand Up @@ -69,3 +71,60 @@ variable "mount_points" {
readOnly = bool
}))
}

variable "health_check" {
description = "The health check for the container"
type = object({
command = list(string)
interval = number
timeout = number
retries = number
startPeriod = number
})
default = null
}

variable "system_controls" {
description = "The system controls for the container"
type = list(object({
namespace = string
value = string
}))
default = null
}

variable "command" {
description = "The command for the container"
type = list(string)
default = null
}

variable "start_timeout" {
description = "The start timeout for the container"
type = number
default = null
}

variable "stop_timeout" {
description = "The stop timeout for the container"
type = number
default = null
}

variable "entry_point" {
description = "The entry point for the container"
type = list(string)
default = null
}

variable "linux_parameters" {
description = "The linux parameters for the container"
type = object({
capabilities = object({
add = list(string)
drop = list(string)
})
initProcessEnabled = bool
})
default = null
}

0 comments on commit 5006b11

Please sign in to comment.