sourceIP missing with ALB?
See original GitHub issueWe’ve got a fairly generic ALB -> Lambda config and are seeing the following issue. sourceIp
is not defined on event.requestContext.identity
(or rather identity
is not defined).
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "TypeError: Cannot read property 'sourceIp' of undefined",
"reason": {
"errorType": "TypeError",
"errorMessage": "Cannot read property 'sourceIp' of undefined",
"stack": [
"TypeError: Cannot read property 'sourceIp' of undefined",
" at getRequestValuesFromEvent (/var/task/api/_dist/node_modules/@vendia/serverless-express/src/event-sources/utils.js:52:50)",
Usage is as follows (app
is in a Promise so we need to await it and then proxy it?):
module.exports.handler = async (event, context, callback): Promise<any> => {
console.debug('index.handler: running');
console.debug(` event: ${util.inspect(event)}`);
console.debug(` context: ${util.inspect(context)}`);
// Start a server (if one doesn't exist), then memoize it.
if (!_server) {
console.debug('index.handler: creating AWSServerlessExpress');
const app = await __setup();
_server = configure({ app, binaryMimeTypes });
dog_log('api', 'boot', 'complete');
}
return _server.proxy({ event, context, callback });
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:18
Top Results From Across the Web
Capture client IP addresses in the web server logs behind an ...
I'm using Elastic Load Balancing (ELB) for my web server, and I can see my load balancer's IP address in the web server...
Read more >Missing Global Accelerator source IPs? - AWS re:Post
Starting today, your applications running on Application Load Balancers (ALB) fronted by AWS Global Accelerator can see the original source IP address of ......
Read more >AWS Pass traffic from NLB to an ALB? - Stack Overflow
It is lost when the traffic goes through the NLB, because NLBs ... ALB (or the ALB itself) will always see the source...
Read more >How do I find the load balancer's IP address used ... - YouTube
AWS Static LB - Integration of NLB with ALB || Concept- Use Case || Demo. Cloud4DevOps. Cloud4DevOps. •. •. 3.9K views 11 months...
Read more >Support ALB advanced request routing · Issue #8126 - GitHub
Query string (new); Source IP (new). Additionally, each condition can now accept multiple values. New or Affected Resource(s).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
4.0.0-rc2
Deny: agreed… If I knew what to deny. I didn’t feel like binary searching with 5 minute latencies…
I think it was a partial download header which was sent by express-static. ‘accept-ranges: bytes’ but I couldn’t find any documentation and AWS Support was unenthusiastic.
I went with a white list not only because I didn’t want to fiddle with identifying the bad header but also because I didn’t want to accidentally discover new ones and I didn’t mind controlling which headers are sent (it’s a pretty standard, static list).
I may have mentioned this already but besides copying your code, I did next to nothing to verify query string functionality.
On Thu, Jan 28, 2021, 3:58 AM Brett Andrews notifications@github.com wrote: