ForgeLaunchLabs Blog

The webhook that never fired: a Lambda Function URL 403

We sell a small digital product, a $17 planner on thesadiewren.com, and delivery runs through a Stripe webhook. A customer pays, Stripe sends an event to a Lambda function, the function emails the download link. It was tested end to end at launch on October 2 and it worked. Then it quietly stopped working, and nobody noticed for a month.

The first sign was a Stripe notice on October 31: 40 failed webhook deliveries, and Stripe would stop sending to the endpoint on November 5 if it stayed broken. Payments themselves had not failed. Customers were paying. The download emails were not going out, because the webhook never reached our code.

What the logs actually said

The first check was CloudWatch, and it told the whole story in one number: zero invocations since the October 2 launch test. Not errors. Not timeouts. Zero. The function had never run for a real purchase, which meant the requests were being stopped before our code ever saw them.

That is the distinction that matters in this kind of debugging. An error inside your function shows up in your logs. A request that never reaches your function does not. If your first instinct is to re-read your handler, you will find nothing wrong, because nothing is wrong with it. Our code, IAM role, and environment were all fine.

The 403 was coming from AWS itself. The Lambda's Function URL was set to AuthType NONE, which sounds like it means open to everyone, and in one sense it does. But a Function URL with no resource-based policy still refuses callers. AWS returned 403 AccessDeniedException to every request, including Stripe's, before any of our code ran. The endpoint looked public and behaved locked.

The fix, and why it took two statements

The fix was permissions, not code. And it took two statements, not one, which is the part worth writing down.

The first statement allowed public access to the Function URL itself: lambda:InvokeFunctionUrl, principal *, auth NONE. We added it, tested, and still got a 403. That statement opens the URL. It does not grant permission to invoke the function behind it.

The second statement did that: lambda:InvokeFunction, principal *. Only with both in place did the endpoint start answering. The verification was immediate and satisfying in the way only a debugging session can be. Instead of the AWS AccessDenied body, we got our own handler's response, a token rejection, which proved the request was finally reaching our code. CloudWatch logged its first invocation since October 2.

Two statements, same resource, different actions. If you only add the first, you will test, see a 403, and conclude the fix did not work. It half worked. That is the trap.

The checklist we use now

Every webhook endpoint we run now gets checked in this order, before we trust it:

  1. Check the sender's dashboard first. Stripe, or whoever sends the events, tells you the delivery history. Forty failures and a cutoff date is a notice you should never need, because the dashboard shows the first failure the same day.
  2. Check invocations, not just errors. Zero invocations means the request never reached your code. Errors mean it did. Those are two different problems with two different fixes, and the log count tells you which one you have in under a minute.
  3. Test the endpoint from outside your own account. A curl from your own machine, or a test event from the sender, exercises the real path. Testing only inside the AWS console exercises a different one, and it will happily pass while the public path is locked.
  4. Read the 403 carefully. A 403 from AWS with an AccessDeniedException body is infrastructure refusing the caller. A 403 from your own handler is your code refusing a bad token. Same status code, different owner, different fix. The body tells you which.
  5. Verify the fix with a real event, not a config read. We knew it worked when CloudWatch showed an invocation and our handler answered. A green check in a console is a claim. An invocation is proof.

What is still owed

The fix covers new purchases. The 40 failed events from October are still sitting in Stripe, and they still need a resend from the dashboard, plus a check of whether any of them was a real sale whose buyer never got a download link. That is a small job, and it is on the list, but it is worth naming plainly: fixing the endpoint does not retroactively deliver the emails it dropped. Every day a broken webhook runs silently is a day of customers who paid and heard nothing. The monitoring that would have caught this on day one costs nothing. The silence cost a month.

If you run a Lambda Function URL as a webhook endpoint, check its resource-based policy today. AuthType NONE is not the same as open. Your code can be perfect and your customers can still be waiting.