ECS タスクは、起動時にはコンテナの依存関係を考慮するのに終了時は全く考慮しません。次のコメントからもよくわかります。 A container can always stop, die, or reach whatever other state it wants regardless of what dependencies it has cf. agent/engine/dependencygraph/graph.go#L179-L180 これの何が問題かというと、fluentd のようなデータ収集用のサイドカーコンテナが動いている場合に、メインのコンテナよりも先にサイドカーコンテナが停止してデータが消失するということが起きてしまいます。 このことは 2 年半前から issue に上がっているんですが、未だに解決されていません。 cf. Termination order of li
![ECS タスクの終了時にコンテナの依存関係が考慮されない問題を解決するコマンドを作った](https://cdn-ak-scissors.b.st-hatena.com/image/square/e4ae451b6eb68f86e6395ff31c162da99986ea8f/height=288;version=1;width=512/https%3A%2F%2Fabicky.net%2Fassets%2Flogo-ecc7933ebcc8ad52763d7bdcc07df22f9534054dd930e28b01860043de7ca6ce70b47c3b5c250c3a275c3d6f107fad47a0b67347b1e199de9a2f603fa32d95aa.png)