title: parameterizing linux_capabilities in ecs task definition
body: <p>I have a terraform configuration to create task definition in ECS Fargate.</p>
  <p>The <strong>main.tf</strong> file looks like this:</p>
  <pre><code>...
  
  data &quot;template_file&quot; &quot;td_template&quot; {
    template = td.tpl&quot;)
    vars = {   
      linux_capabilities = &quot;&quot;
    }
  }
  
  resource &quot;aws_ecs_task_definition&quot; &quot;fargate&quot; {
    family                   = &quot;mytd&quot;
    container_definitions    = data.template_file.td_template.rendered
    network_mode             = &quot;awsvpc&quot;
    cpu                      = &quot;1024&quot;
    memory                   = &quot;2048&quot;
    execution_role_arn       = &quot;arn:aws:iam::xxxxx:role/ecs&quot;
    task_role_arn            = &quot;arn:aws:iam::xxxxx:role/ecs&quot;
  }
  
  ...
  </code></pre>
  <p>And, the <strong>td.tpl</strong> file looks like this:</p>
  <pre><code>[
    {
      &quot;image&quot;: &quot;xxxxx.dkr.ecr.eu-west-1.amazonaws.com/myserv:latest&quot;,
      &quot;name&quot;: &quot;myserv&quot;,
      &quot;linuxParameters&quot;: {
        &quot;capabilities&quot;: {
          &quot;add&quot;: [&quot;${linux_capabilities}&quot;]
          }
        },
      &quot;cpu&quot;: 1024,
      &quot;memory&quot;: 2048
    }
  ]
  </code></pre>
  <p>I wanted to parameterize that <strong>linux capabilities</strong> thing. If I add some values(for eg: below snippet) to that <strong>linux_capabilities parameter</strong> in data statement, It works.</p>
  <pre><code>linux_capabilities = &quot;SYS_PTRACE&quot;
  </code></pre>
  <p>But, with empty <strong>&quot;&quot;</strong> doesn't work. It shows this error:</p>
  <pre><code>Error: error creating ECS Task Definition (missing-back-svc): ClientException: Unrecognized Linux capabilities in add: []
  </code></pre>
  <p>Does anyone has any idea about <strong>parameterizing(set and unset)</strong> those linux capabilities settings?</p>
  <p>Any suggestions are appreciated.</p>