2

Ich versuche, die LogConfiguration für eine bestimmte Aufgabendefinition gehen zu lassen. Aber CloudFormation beschwert sich darüber, dass es Encountered unsupported property logConfigurationAmazon ECS LogConfiguration gibt "nicht unterstützte Eigenschaft logConfiguration" zurück

Laut der Dokumentation sollte es in der Lage sein, es zu verwenden.

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" 
     } 
    }, 
    } 
] 

Jede Ahnung, was ich fehle?

+0

angegeben haben Sie die --log-Treiber Option beim Start von Docker Dämon? – Shibashis

Antwort

1

Sie suchen die Amazon ECS-Dokumentation anstelle der AWS CloudFormation-Dokumentation.

Nach Cloudformation Amazon EC2 Container Service TaskDefinition ContainerDefinitionslogConfiguration ist nicht Teil der 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, ... ] 
} 
0

Ich bin mir nicht sicher, ob LogConfiguration in Cloudformation nicht zur Verfügung stand diese Frage damals gefragt wurde, aber es ist jetzt.

Es ist auch Groß- und Kleinschreibung, so dass Sie logConfiguration zu LogConfiguration zu ändern brauchen, logDriver zu LogDriver und options-Options. Wie so:

"ContainerDefinitions" : [ 
    { 
    "Name": "foo", 
    "PortMappings": [ ... code omitted ... ], 
    "LogConfiguration" : { 
     "LogDriver" : "fluentd", 
     "Options" : { 
     "fluentd-address" : "foo:24224", 
     "tag" : "foobar" 
     } 
    } 
    } 
] 

habe ich nicht mit fluentd getestet, aber ich weiß, diese Konfiguration mit dem awslogs Treiber funktioniert:

"ContainerDefinitions": [ 
    { 
    "Name": { "Ref": "ContainerName" }, 
    "PortMappings": [ ... code omitted ... ], 
    "LogConfiguration": { 
     "LogDriver": "awslogs", 
     "Options": { 
     "awslogs-group": { "Ref": "LogGroupName" }, 
     "awslogs-region": { "Ref": "AWS::Region" }, 
     "awslogs-stream-prefix": { "Ref": "ContainerName" } 
     } 
    } 
    } 
]