Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config for jenkins container #49

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 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 All @@ -135,7 +135,7 @@ module "td" {
docker_volume_configuration = []
efs_volume_configuration = [{
file_system_id = aws_efs_file_system.jenkins_data.id
root_directory = "/var/jenkins_home"
root_directory = "/"
transit_encryption = "DISABLED"
transit_encryption_port = null
authorization_config = []
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" {
ktibi marked this conversation as resolved.
Show resolved Hide resolved
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" {
ktibi marked this conversation as resolved.
Show resolved Hide resolved
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