Skip to content

Commit

Permalink
linux parameters add (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiplesa authored Aug 10, 2024
1 parent 29b990e commit daee724
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ module "container_definition" {
mount_points = var.mount_points
container_depends_on = local.container_depends_on
repository_credentials = var.container_repo_credentials
linux_parameters = merge(
var.linux_parameters,
var.exec_enabled ? { initProcessEnabled = true } : {}
)

log_configuration = var.cloudwatch_log_group_enabled ? {
logDriver = var.log_driver
Expand Down
26 changes: 26 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,32 @@ variable "container_repo_credentials" {
description = "Container repository credentials; required when using a private repo. This map currently supports a single key; \"credentialsParameter\", which should be the ARN of a Secrets Manager's secret holding the credentials"
}

# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html
variable "linux_parameters" {
type = object({
capabilities = optional(object({
add = optional(list(string))
drop = optional(list(string))
}))
devices = optional(list(object({
containerPath = optional(string)
hostPath = optional(string)
permissions = optional(list(string))
})))
initProcessEnabled = optional(bool)
maxSwap = optional(number)
sharedMemorySize = optional(number)
swappiness = optional(number)
tmpfs = optional(list(object({
containerPath = optional(string)
mountOptions = optional(list(string))
size = number
})))
})
description = "Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html"
default = {}
}

variable "ecr_scan_images_on_push" {
type = bool
description = "Indicates whether images are scanned after being pushed to the repository (true) or not (false)"
Expand Down

0 comments on commit daee724

Please sign in to comment.