title: awsvpc: Network Configuration is not valid for the given networkMode of this task definition
body: <p>My task definition: </p>
  
  <pre><code>resource "aws_ecs_task_definition" "datadog" {
    family        = "${var.environment}-datadog-agent-task"
    task_role_arn = "arn:aws:iam::xxxxxxxx:role/datadog-role"
  
    container_definitions = &lt;&lt;EOF
  [
    {
      "name": "${var.environment}-${var.datadog-identifier}",
      "network_mode" : "awsvpc",
      "image": "datadog/agent:latest",
      "portMappings": [
        {
  ...
  </code></pre>
  
  <p>My service defintion: </p>
  
  <pre><code>resource "aws_ecs_service" "datadog" {
    name            = "${var.environment}-${var.datadog-identifier}-datadog-ecs-service"
    cluster         = "${var.cluster}"
    task_definition = "${aws_ecs_task_definition.datadog.arn}"
  
    network_configuration {
      subnets = flatten(["${var.private_subnet_ids}"])
    }
  
    # This allows running one for every instance
    scheduling_strategy = "DAEMON"
  }
  </code></pre>
  
  <p>I get the following error - </p>
  
  <pre><code>InvalidParameterException: Network Configuration is not valid for the given networkMode of this task definition
  </code></pre>
  
  <p>Is there something I am missing here? Looking at the Terraform docs and GitHub issues this should have worked. Is it related to running Datadog as a daemon?</p>