Skip to content

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.

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

2 participants