Using terraform, I am trying to attach an EFS volume to a container. I would specify a folder to mount on rather than the root path. I have tried everything but no matter what I do, the root_directory option seems to be ignored.
This is my task definition snippet:
resource "aws_ecs_task_definition" "ecs_task_def" {
family = "application"
container_definitions = jsonencode([
{
...
},
{
name : "redis",
mountPoints = [
{
"readOnly" : null,
"containerPath" : "/bitnami/redis/data",
"sourceVolume" : "efs"
}
],
...
}
])
...
volume {
name = "efs"
efs_volume_configuration {
file_system_id = var.ecs_efs_filesystem_id
transit_encryption = "DISABLED"
root_directory = "/some/path/here"
authorization_config {
iam = "DISABLED"
}
}
}
}
No matter what I try to do, the container always mounts on the at the root. I have tried creating the folders myself but nothing changes. No matter what I do, I always end up with this:
I would appreciate it if someone could tell where I could be going wrong. Thank you.
