Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

376
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda