Skip to content

Error: ClientException: Fargate requires that 'cpu' be defined at the task level. #38

Closed
@epicfaace

Description

@epicfaace

I'm trying to create a MongoDB ECS task definition using Fargate:

module "mongo-task-definition" {
  source = "github.com/mongodb/terraform-aws-ecs-task-definition"

  family = "mongo"
  image  = "mongo:3.6"
  cpu    = 1
  memory = 512
  name   = "mongo"
  requires_compatibilities = ["FARGATE"]
  network_mode = "awsvpc"
  environment = [
    {
      name = "MONGO_INITDB_ROOT_USERNAME"
      value = "root"
    },
    {
      name = "MONGO_INITDB_ROOT_PASSWORD"
      value = "root"
    }
  ]

  portMappings = [
    {
      containerPort = 27017
    },
  ]
}

But then get this error: "Error: ClientException: Fargate requires that 'cpu' be defined at the task level."

It seems that although I am passing cpu to this module, it isn't actually adding cpu to resource "aws_ecs_task_definition" "ecs_task_definition".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions