aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.51k stars 438 forks source link

SAM/Lambda: better support for API-based lambdas (APIGateway) #2455

Open JadenSimon opened 2 years ago

JadenSimon commented 2 years ago

Parent issue to track features or improvements regarding API-based lambdas.

Proposed new features:

General improvements and bug fixes:

justinmk3 commented 2 years ago

Uniform timeouts

We could have very large timeouts if the Toolkit correctly handled VSCode debugger "Stop" button (assuming VSCode gives us a way to do this). Or as a workaround we could present a progress status w/ "Cancel" button.

JadenSimon commented 2 years ago

Yeah, many of the timeouts (in the run/debug flow) seem to be more like workarounds rather than features. We still want to know if a process is hanging, but I think it's best if we give the user the final choice in cancelling an operation. The automatic cancellation has caused a lot of issues.

bryantqo commented 2 years ago

I would also like to see being able to "attach" to an externally running instance of start-api i.e. in a terminal window I run sam local start-api -p 1234 -d 1235 and then be able to attach to that process on port 1235 without needing to define a payload. The debugging session would then remain "open" for all requests coming in. Additionally the ability for it to continue without a debugger attached is crucial. To that effect I would love it if:

  1. For invokeTarget.type = "api" a nvokeTarget.logicalId would not be required
  2. The debugging session to be smart enough to know how, based on the resulting function called, to properly connect to the correct source
  3. Remove the api definition from being required
  4. Do not automatically break on the entrypoint
  5. Able to attach to an already running start-api
justinmk3 commented 2 years ago

@bryantqo I added some notes to #2535 to try to capture your idea.