Home > database >  How to specify an operating System Family for Fargate task definition?
How to specify an operating System Family for Fargate task definition?

Time:12-04

I am using terraform to create a Fargate task definition but I am having some difficulty specifying the Runtime platform version. According to AWS's docs the task definition operatingSystemFamily property does exist. Its default value is LINUX. I would like to change that to Windows Server 2019 Core as I would like to use Windows containers on Fargate.

Having said that, I am unable to find it on the Terraform's aws_ecs_task_definition resource documentation.

This is my task definition:

resource "aws_ecs_task_definition" "transform_service" {
  family                   = "${var.app_name}-transform-service-task"
  network_mode             = "awsvpc"
  requires_compatibilities = ["FARGATE"]
  cpu                = 2 * 1024  #2 vCPU
  memory             = 16 * 1024 # 16GB
  execution_role_arn = aws_iam_role.transform_service_task_execution_role.arn
  
  container_definitions = jsonencode([{
    name      = "transform-service-container-${var.environment}"
    image     = "${var.transform_service_repository_url}:latest"
    essential = true
    environment = [{
      "name" : "DOTNET_ENVIRONMENT", "value" : "Development"
    }]
    },

  ])
}

CodePudding user response:

It's not yet supported. There are GitHub issues for that already:

with a PR ready:

  • Related