By using AWS re:Post, you agree to the Terms of Use
/Custom hosts file on Lambda image/

Custom hosts file on Lambda image


I need to add an entry into /etc/hosts file when running a lambda function using an ECR image. In ECS I can use the HostEntry property, but I can't found any similar option on Lambda. Is there any way to modify this file?

Thank you!

1 Answers

Lambda filesystem is read-only, except /tmp

So you cannot change the content of /etc/hosts at runtime

Instead, you can change the content during image build-time if you know the value upfront.

answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions