Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to specify listening port #17

Open
laynr opened this issue Jan 22, 2021 · 4 comments
Open

option to specify listening port #17

laynr opened this issue Jan 22, 2021 · 4 comments

Comments

@laynr
Copy link

laynr commented Jan 22, 2021

Desire a way to specify listening port to aws-lambda-rie.

This could be with an ENV in the Dockerfile similar to "DOCKER_LAMBDA_API_PORT" in lambci/docker-lambda#235

Or with an argument to aws-lambda-rie like -p80 or at least by mapping like -p80:8080. so the lambda_entrypoint.sh would look like

#!/bin/sh
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
  exec /usr/local/bin/aws-lambda-rie -p80 $RUNTIME_ENTRPOINT
else
  exec $RUNTIME_ENTRPOINT
fi 

I am aware of the docker option docker run -p 80:8080 but I am asking for a way to do it in the dockerfile as an ENV or modifying the entrypoint script when calling aws-lambda-rie.

ENV AWS_LAMBDA_RUNTIME_API 127.0.0.1:80 resulted in "Failed to get next"

@regmicmahesh
Copy link

+1

1 similar comment
@rmzi
Copy link

rmzi commented Feb 23, 2022

+1

@cibinmathew
Copy link

@laynr
Instead of ric, by any chance are you looking for using custom port in local using rie (https://github.com/aws/aws-lambda-runtime-interface-emulator)

@talkopeliovich
Copy link

talkopeliovich commented Jan 22, 2023

This is acutely relevant when running tests mocking several lambdas & a secrets manager. Secrets manager on host cannot be accessed without jumping through ip table hoops. Getting an option to specify ports would let us use network=host and not worry about lambdas listening on the same port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants