I'm trying to mount EFS onto our currenct ECS farg...
# infra-deployment
s
I'm trying to mount EFS onto our currenct ECS fargate container, but for some reason it seems to be unable to connect. After a while, I just get the error:
ResourceInitializationError: failed to invoke EFS utils commands to set up EFS volumes: stderr: Failed to resolve "<http://fs-xxxxxxxxxxx.efs.us-east-1.amazonaws.com|fs-xxxxxxxxxxx.efs.us-east-1.amazonaws.com>
. Has anyone ever encountered this issue?
a
My first hunch would be to double check IAM for the ECS roles (there are 2 important ones). If the proper ECS role doesn't have access to the EFS filesystem (or if there's no valid network route) that would likely lead to a message like this one.
These are poorly named (IMHO), but I think the role that needs to have access to that resource the "execution role" which (if I'm not mixing them up) is responsible for bootstrapping the container prior to and up to the launch of the chosen image. Amazon ECS task execution IAM role - Amazon Elastic Container Service
It has been a while since I've worked with these, so it's possible this is a red herring. Hope it helps though!
s
@aaronsteers thanks for the answer (sorry for the delay, I took a long weekend). I'll look into IAM roles and get back to you! For posterity, I also asked the question on stack overflow: https://stackoverflow.com/questions/72145870/efs-on-aws-fargate-using-terraform-cant-connected?noredirect=1#comment127485679_72145870
Update: we gave up and just setup 2 rds dbs. Was simpler and allowed us to move on to other things 😛