No, you don’t need to do any of that. ECS can inject secrets into environment variables in much the same way as Kubernetes. This behaviour is already built-in, there’s no need to build your own solution for it.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/...