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

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

Closed
epicfaace opened this issue Jun 27, 2020 · 3 comments

Comments

@epicfaace
Copy link

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".

@jasonwalsh
Copy link
Member

Related to #37

I will merge today

@jasonwalsh
Copy link
Member

Released https://github.com/mongodb/terraform-aws-ecs-task-definition/releases/tag/v2.1.0

@epicfaace
Copy link
Author

Thanks! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants