Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

373
Vistas
How to mount a EFS sub folder in an ECS cluster using Terraform?

I have an EFS that I want to mount it to an ECS cluster (running on EC2 instances).

My cluster is running multiple apps and I want that each app use a sub folder of the EFS.

During the launch config of the EC2 I create the different folders for apps under /mnt/efs

Then I tried in the Task Definition to put the subfolder in the EFS URL this way:

resource "aws_ecs_task_definition" "task_definition" {
  ...
  volume {
    name = "efs_app1"
    docker_volume_configuration {
      scope         = "shared"
      autoprovision = true
      driver        = "local"
      driver_opts = {
        "type"   = "nfs"
        "device" = "${aws_efs_file_system.efs.dns_name}:/"
        "o"      = "addr=${aws_efs_file_system.efs.dns_name}:/app1,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2"
      }
    }
  }

But the container is unable to start and generates this error:

Status reason CannotCreateContainerError: Error response from daemon: error resolving passed in nfs address: lookup fs-xxxxxxx.efs.eu-west-1.amazonaws.com:/app1: no such host

I'm not sure of the syntax that I used to specify the sub folder when mounting the volume. Is it correct? Or is there any way to fix that?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda