Saturday, October 29, 2022

[SOLVED] Amazon ECS LogConfiguration returns "unsupported property logConfiguration"

Issue

I am trying to get the LogConfiguration going for a specific task definition. But CloudFormation keeps complaining that it Encountered unsupported property logConfiguration

According to the documentation is should be able to use it.

http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_storage

"ContainerDefinitions" : [
  {
    "Name": "foo",
    "PortMappings": [ ... code omitted ... ],
    "logConfiguration" : {
      "logDriver" : "fluentd",
      "options" :  {
        "fluentd-address" : "foo:24224",
        "tag" : "foobar"
      }
    },
  }
]

Any clue what I am missing?


Solution

You are looking at Amazon ECS documentation instead of AWS CloudFormation documentation.

According to CloudFormation Amazon EC2 Container Service TaskDefinition ContainerDefinitions logConfiguration is not part of ContainerDefinitions

{
  "Command" : [ String, ... ],
  "Cpu" : Integer,
  "EntryPoint" : [ String, ... ],
  "Environment" : [ Environment Variable, ... ],
  "Essential" : Boolean,
  "Image" : String,
  "Links" : [ String, ... ],
  "Memory" : Integer,
  "MountPoints" : [ Mount Point, ... ],
  "Name" : String,
  "PortMappings" : [ Port Map, ... ],
  "VolumesFrom" : [ Volume From, ... ]
}


Answered By - helloV
Answer Checked By - Marilyn (WPSolving Volunteer)