hashicorp / terraform-aws-consul-ecs

Consul Service Mesh on AWS ECS (Elastic Container Service)
https://www.consul.io/docs/ecs
Mozilla Public License 2.0
52 stars 31 forks source link

AWS execute command is not compatible with task def readonlyRootFilesystem #228

Open v-rosa opened 11 months ago

v-rosa commented 11 months ago

Currently it's not possible to run the ecs execute-command action if the task-def sets readonlyRootFilesystem to true. E.g.

aws ecs execute-command  \
    --region us-east-1 \
    --cluster stg-internal-pet \
    --task 355ef4d394294fdd91acb5af1876806f \
    --container consul-ecs-controller \
    --command "/bin/bash" \
    --interactive

Given by default ECS Controller enables both:

Execute command won't work if some work arounds are implemented, like:

Or if we disable readonlyRootFilesystem when we decide to enable enable_execute_command at the ECS service level.

Btw this issue was introduced by me here: https://github.com/hashicorp/terraform-aws-consul-ecs/commit/8a8b9b06bdbbb4f3f50b322af42a01d2c3d4999e