Skip to content

Commit dd2cadd

Browse files
CoderCococlaude
andauthored
fix(interactions): add lambda:InvokeFunction permission for Function URL (#29)
## Summary - Since October 2025, Lambda Function URLs require **both** `lambda:InvokeFunctionUrl` (created automatically by `aws_lambda_function_url`) **and** `lambda:InvokeFunction` in the resource-based policy - Without the second permission, any request to the Function URL receives `403 Forbidden` before the Lambda handler runs — this was causing Discord's endpoint validation PING to fail with "could not be verified" - Adds `aws_lambda_permission.interactions_url_invoke` to `interactions.tf` to codify the fix; the permission was already applied as a hotfix via `aws lambda add-permission` - Also ignores `.make/` in `.gitignore` ## Test plan - [x] Hotfix applied: `curl -X POST https://discord.codercoco.com/` now returns `401 invalid request signature` (handler reached) instead of `403 Forbidden` - [ ] Run `terraform plan` — should show only the new `aws_lambda_permission` resource (no destructive changes) - [ ] Run `terraform apply` — permission is already in place; Terraform should reconcile cleanly - [ ] Re-enter the interactions endpoint URL in the Discord Developer Portal and confirm "Successfully verified" 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ebda67e commit dd2cadd

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ Thumbs.db
2727
# lives at .claude/settings.json (commit that instead if you want the
2828
# allowlist shared across the team).
2929
.claude/settings.local.json
30+
31+
.make

terraform/interactions.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ resource "aws_lambda_function_url" "interactions" {
105105
}
106106
}
107107

108+
# Since October 2025, Lambda Function URLs require both lambda:InvokeFunctionUrl
109+
# (created automatically by aws_lambda_function_url) and lambda:InvokeFunction.
110+
resource "aws_lambda_permission" "interactions_url_invoke" {
111+
statement_id = "FunctionURLInvokeAllowPublicAccess"
112+
action = "lambda:InvokeFunction"
113+
function_name = aws_lambda_function.interactions.function_name
114+
principal = "*"
115+
function_url_auth_type = "NONE"
116+
}
117+
108118
output "interactions_invoke_url" {
109119
description = "Paste this into the 'Interactions Endpoint URL' field in the Discord Developer Portal"
110120
value = "https://discord.${var.hosted_zone_name}/"

0 commit comments

Comments
 (0)