Skip to content

fix(aws): add InvokeFunction permission for public Function URLs#6358

Closed
bruno-espino wants to merge 1 commit intoanomalyco:devfrom
bruno-espino:fix/function-url-invoke-permission
Closed

fix(aws): add InvokeFunction permission for public Function URLs#6358
bruno-espino wants to merge 1 commit intoanomalyco:devfrom
bruno-espino:fix/function-url-invoke-permission

Conversation

@bruno-espino
Copy link

Fixes #6198

What this PR changes

  • When sst.aws.Function is configured with url.authorization: "none", SST now adds an explicit resource-based permission:
    • action: "lambda:InvokeFunction"
    • principal: "*"
    • function: <function name>

This matches the AWS console guidance for public Function URLs and fixes existing stacks without requiring a manual policy edit.

Notes / follow-ups

  • The AWS console scopes the InvokeFunction statement with lambda:InvokedViaFunctionUrl=true.
  • This PR adds the minimal required permission via aws.lambda.Permission and includes an inline comment to remove it after we migrate to @pulumi/aws v7 (where Lambda/provider behavior matches the current
    console policy).

Repro

new sst.aws.Function("Api", {
  handler: "src/lambda.handler",
  url: { authorization: "none" },
});

Deploy and hit the function URL; before this change you'll get 403

@jakehewitt
Copy link

Tested this PR and verified it works

Comment on lines +2518 to +2519
// deployments). This can be removed after migrating to @pulumi/aws v7
// (where Lambda/provider behavior matches the current AWS console policy).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might not have tested this correctly but I don't think upgrading to @pulumi/aws v7 fixes this automatically. I tested by cloning #6259 and upgrading from v7.12.0 → v7.16.0 (which includes terraform-provider-aws v6.28.0 where hashicorp/terraform-provider-aws#44829 was resolved), but the issue persisted without these changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the fix for v7 was an assumption from my side, I didn't test it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vimtor if jake cloned from #6259 looks like this is still an issue

@vimtor vimtor self-assigned this Feb 2, 2026
@vimtor
Copy link
Collaborator

vimtor commented Feb 5, 2026

let's wait on merging #6259 first to see if the warning disappears

@vimtor
Copy link
Collaborator

vimtor commented Feb 14, 2026

thanks for your contribution @bruno-espino

closed in favor of #6400 which contains the fix for protection: "oac" mode too

let's wait on merging #6259 first to see if the warning disappears

i've changed my mind on this since i don't want new users to wait on the v7 to get merged for this common use-case to work

@vimtor vimtor closed this Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda Function URL Permissions not AWS-compliant

3 participants