Currently, there is one port is exposed from Docker instance when running lambda in debug mode. This port is used to connect a debugger. In my case, I need two ports to be exposed due to Debugger implementation specific (the Debugger connect to two sockets to collect different information).
SAM CLI has a --debug-port
parameter that provide a port. This parameter is stored in DebugContext object.
DebugContext
should store an array of ports instead of a single port. This array should be transformed
into a map containing each stored port when passing to docker container arguments.
All ports specified via single or multiple --debug-port
SAM CLI options should be exposed by docker container.
From the user perspective, it should only provide an ability to specify multiple --debug-port
options:
--debug-port 5600 --debug-port 5601
SAM CLI provide an option to specify multiple ports --debug-port 5600 --debug-port 5601
.
No changes.
Update --debug-port
option to allow to use it multiple times in SAM CLI.
The option type should take only integer values. The value is stored in DebugContext
.
This value should be converted into a map of { container_port : host_port }
that is passed to ports
argument when creating a docker container.
No changes.
No changes.
What new dependencies (libraries/cli) does this change require?
What other Docker container images are you using?
Are you creating a new HTTP endpoint? If so explain how it will be created & used
Are you connecting to a remote API? If so explain how is this connection secured
Are you reading/writing to a temporary folder? If so, what is this used for and when do you clean up?
How do you validate new .samrc configuration?
Make sure SAM CLI users can specify multiple ports and those ports are exposed after creating a docker container in debug mode:
sam local invoke --template <path_to_template>/template.yaml --event <path_to_event>/event.json --debugger-path <path_to_debugger> --debug-port 5600 --debug-port 5601
Running SAM CLI with debug mode.
- Single port is specified:
--debug-port 5600
- Multiple ports are specified:
--debug-port 5600 --debug-port 5601
- No ports specified:
--debug-port
- No
--debug-port
parameter is specified
- Single port is exposed in docker container
- All specified ports are exposed in docker container
- No ports exposed.
- No ports exposed.
- Send a Pull Request with this design document
- Build the command line interface
- Build the underlying library
- Unit tests
- Functional Tests
- Integration tests
- Run all tests on Windows
- Update documentation