Closed
Description
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
Labels
No labels