question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to use {proxy+} in my route for template-based API Gateway debugging?

See original GitHub issue

Desktop (please complete the following information):

  • OS: Windows 10
  • VS Code version: 1.63.2
  • AWS Toolkit extension version: 1.35.0

Question

I have an SAM template setup such that my API Gateway has a single route that consists only of /{proxy+} and with it I’m using Express JS. In the documentation, it states that the api.path value…

Must be a valid API path resolved from the template.yaml specified by invokeTarget.templatePath.

I tried setting up api.path in the launch.json configuration with both a valid route and with /{proxy+} (which I knew wouldn’t work, but hey), but I get the follow error in either case:

[ERROR]: Local API failed to respond (ECONNREFUSED) after 30 retries, path: /{proxy+}, error: connect ECONNREFUSED 127.0.0.1:5860

Is it possible to use AWS Toolkit debugging with this setup?

Thanks.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ryancabanascommented, Jan 27, 2022

@JadenSimon,

Sorry. I forgot to provide the launch.json configuration, which I created using the AWS: SAM Debug Configuration Editor in VSCode, which is pretty neat. Didn’t know that existed. Anyway, here’s my configuration.

{
    "configurations": [
        {
            "type": "aws-sam",
            "request": "direct-invoke",
            "invokeTarget": {
                "target": "api",
                "logicalId": "HelloWorldFunction",
                "templatePath": "C:\\Users\\Ryan\\Desktop\\projects\\tests\\sam-app\\template.yaml"
            },
            "lambda": {
                "runtime": "nodejs14.x"
            },
            "sam": {
                "containerBuild": false,
                "skipNewImageCheck": false
            },
            "api": {
                "path": "/hello",
                "httpMethod": "get"
            },
            "name": "Test"
        }
    ]
}
0reactions
JadenSimoncommented, Jan 28, 2022

For example, I use -p for different ports sometimes, I needed to use --parameter-overrides today, I often use -l for logging, and I’ve come to appreciate --warm-containers too. Not to make better debugger support more difficult to implement, but just thought I’d mention some of those often-used switches while we’re on the topic. 😁

That’s definitely a pain-point. Right now the toolkits have an ‘escape-hatch’ in the launch configurations via localArguments (or buildArguments for building) that forwards arguments to SAM CLI:

  "sam": {
        "localArguments": ["-p", "4040"]
    },

But this specific example would break debugging sam local start-api as the toolkit expects the ports to be in a certain way. And I’m sure there’s plenty of things SAM CLI supports that just wouldn’t work nicely with the toolkit. Definitely appreciate the feedback though, very helpful!

Thanks so much again! Have a good weekend!

You’re welcome! You as well. I’m closing out this issue and opening a new one to track API debugging improvements which I’ll link back here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up a proxy integration with a proxy resource - Amazon API ...
The Lambda proxy integration, designated by AWS_PROXY in the API Gateway REST API, is for integrating a method request with a Lambda function...
Read more >
Chapter 12. Troubleshooting the API infrastructure
Check that there are no firewalls or proxies between the API Gateway and the public ... Use the 3scale debug header to double-check...
Read more >
Proxmox Mail Gateway Administration Guide
Configure Proxmox Mail Gateway to forward the incoming SMTP traffic to your mail server (Configuration/Mail Proxy/Default Relay) - Default Relay is your ......
Read more >
Amazon API Gateway: Explaining HTTP Proxy in HTTP API
HTTP_PROXY : The HTTP proxy integration allows a client to access the backend HTTP endpoints with a streamlined integration setup on single API...
Read more >
Test patterns for discovering AWS API Gateway and AWS ...
Run the horizontal and top-down discovery using Amazon AWS API Gateway [cmdb_ci_cloud_gateway] and Amazon AWS Lambda ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found