Skip to content

Commit

Permalink
Add config for jenkins container
Browse files Browse the repository at this point in the history
  • Loading branch information
ktibi committed Feb 16, 2023
1 parent faf8345 commit 3d99799
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ module "td" {

name_prefix = "${var.name_prefix}-jenkins"
container_name = local.container_name
container_image = "cnservices/jenkins-master"
container_cpu = 2048 # 2 vCPU - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
container_memory = 4096 # 4 GB - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
container_image = var.container_image
container_cpu = var.container_cpu
container_memory = var.container_memory
port_mappings = local.td_port_mappings
healthcheck = local.healthcheck
log_configuration = {
Expand Down
27 changes: 27 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@ variable "enable_autoscaling" {
default = true
}

#------------------------------------------------------------------------------
# AWS ECS
#------------------------------------------------------------------------------
variable "container_image" {
description = "Name of the docker image used for deploy jenkins"
type = string
default = "cnservices/jenkins-master"
}

#------------------------------------------------------------------------------
# AWS ECS Container Definition Variables
#------------------------------------------------------------------------------

# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
variable "container_memory" {
type = number
description = "(Optional) The amount of memory (in MiB) to allow the container to use. This is a hard limit, if the container attempts to exceed the container_memory, the container is killed. This field is optional for Fargate launch type and the total amount of container_memory of all containers in a task will need to be lower than the task memory value"
default = 4096 # 4 GB
}

# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
variable "container_cpu" {
type = number
description = "(Optional) The number of cpu units to reserve for the container. This is optional for tasks using Fargate launch type and the total amount of container_cpu of all containers in a task will need to be lower than the task-level cpu value"
default = 2048 # 2 vCPU
}

#------------------------------------------------------------------------------
# CloudWatch logs
#------------------------------------------------------------------------------
Expand Down

0 comments on commit 3d99799

Please sign in to comment.