Skip to content

Commit

Permalink
Remove ECS task definition template file for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlucci committed Nov 27, 2023
1 parent d4346ae commit 1175b5c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 62 deletions.
64 changes: 27 additions & 37 deletions terraform/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,43 +49,33 @@ resource "aws_iam_role_policy_attachment" "legacy_listener_aws_task_execution_ro

# Task definition for Hello World server featuring CloudWatch logs integration
resource "aws_ecs_task_definition" "hello_world" {
# container_definitions = jsonencode([
# {
# # The same value is used for task and service because there is only one task.
# cpu = var.cpu
# # TODO: parameterize image and/or adjust for a customized container image
# image = "nginxdemos/hello:0.3"
# logConfiguration = {
# logDriver = "awslogs"
# options = {
# "awslogs-group" : aws_cloudwatch_log_group.hello_world.name
# "awslogs-region" : var.aws_region
# "awslogs-stream-prefix" : local.namespace
# }
# },
# # The same value is used for task and service because there is only one task.
# memory = var.memory
# name = "hello-world"
# networkMode = "FARGATE"
# portMappings = [
# {
# hostPort = 80,
# containerPort = 80,
# protocol = "tcp"
# }
# ]
# }
# ])

container_definitions = templatefile("${path.module}/templates/ecs-task-definition--hello-world.tpl", {
cpu = var.cpu
image = local.ecs_hello_world_image
memory = var.memory
namespace = local.namespace
log_group_name = aws_cloudwatch_log_group.hello_world.name
log_group_region = var.aws_region
log_group_prefix = local.namespace
})
container_definitions = jsonencode([
{
# The same value is used for task and service because there is only one task.
cpu = var.cpu

image = local.ecs_hello_world_image
logConfiguration = {
logDriver = "awslogs"
options = {
"awslogs-group" : aws_cloudwatch_log_group.hello_world.name
"awslogs-region" : var.aws_region
"awslogs-stream-prefix" : local.namespace
}
},
# The same value is used for task and service because there is only one task.
memory = var.memory
name = "hello-world"
networkMode = "FARGATE"
portMappings = [
{
hostPort = 443,
containerPort = 443,
protocol = "tcp"
}
]
}
])

cpu = var.cpu
execution_role_arn = aws_iam_role.ecs_task_execution.arn
Expand Down
25 changes: 0 additions & 25 deletions terraform/templates/ecs-task-definition--hello-world.tpl

This file was deleted.

0 comments on commit 1175b5c

Please sign in to comment.