Skip to content

Commit

Permalink
feat: use default image name for initial deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
DecFox committed Mar 19, 2024
1 parent b48576a commit 02c9d78
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tf/modules/oonith_service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@ locals {
container_port = 80
}

data "aws_ecs_task_definition" "oonith_service_current" {
task_definition = "${local.name}-td"
}

# data "aws_ecs_task_definition" "oonith_service_current" {
# task_definition = "${local.name}-td"
# }

# Note: Uncomment the data block after we have an
# initial ecs task definition. We can then start
# using the image name from the existing deployed
# task (commented in the resource)
resource "aws_ecs_task_definition" "oonith_service" {
family = "${local.name}-td"
container_definitions = jsonencode([
{
cpu = var.task_cpu,
essential = true,
image = try(
jsondecode(data.aws_ecs_task_definition.oonith_service_current.task_definition).ContainerDefinitions[0].image,
var.default_docker_image_url
),
# image = try(
# jsondecode(data.aws_ecs_task_definition.oonith_service_current.task_definition).ContainerDefinitions[0].image,
# var.default_docker_image_url
# ),
image = var.default_docker_image_url,
memory = var.task_memory,
name = local.name,
portMappings = [
Expand Down

0 comments on commit 02c9d78

Please sign in to comment.