2 Respuestas
- Más nuevo
- Más votos
- Más comentarios
0
Why are you trying to modify the /etc/hosts file for a container image that will be used to run a lambda function?
0
You can't change /etc/hosts when the function is running as the entire Lambda file system is read only, with the exception of the /tmp.
Saying that, you can modify it at build time. Just add a line COPY my_hosts_file /etc/hosts
to the Dockerfile
.
Contenido relevante
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 2 años
I am trying to reach one of our domains that is public facing but locked down with a sign in page, but its also available internally with no signing page if your on the vpc, This container will be running some automation test against the site.
If you configure the lambda function to be VPC enabled, then the lambda will access this service using an ENI that is created by lambda inside the VPC. So to your domain it should appear like it is coming from a private IP address inside the VPC subnet. It should be no different from if you were to run the same code from an EC2 machine inside the VPC.
Yes, I added the lambda to be VPC enabled, the issue is when the test tries to run and go to the my.domain.com the lambda , resolves the domain to the public IP address since that is what we have in our DNS registrar. We also have the ability to hit the my.domain.com internally using the private IP. So ideally I would like the lambda to resolve the domain to the internal IP and since it already has access in our vpc it should work.
Please check if this helps resolve your problem - https://aws.amazon.com/blogs/compute/powering-secondary-dns-in-a-vpc-using-aws-lambda-and-amazon-route-53-private-hosted-zones/