Skip to content

Support configuring number of provisioned concurrent lambdas#141

Open
Piccirello wants to merge 3 commits intofivexl:mainfrom
PostHog:no-more-cold-starts
Open

Support configuring number of provisioned concurrent lambdas#141
Piccirello wants to merge 3 commits intofivexl:mainfrom
PostHog:no-more-cold-starts

Conversation

@Piccirello
Copy link

@Piccirello Piccirello commented Jan 27, 2026

This change allows users to configure a minimum number of provisioned access requester lambdas. The ultimate goal is reducing cold starts and increasing the speed with which the Slack modal is shown. This also removes the long deprecated create_lambda_url input.


Note

Medium Risk
Changes Lambda invocation wiring (API Gateway integration ARN and trigger permissions) and introduces provisioned concurrency/aliasing, which can break Slack request routing if misconfigured.

Overview
Adds a new slack_handler_provisioned_concurrent_executions input to optionally enable provisioned concurrency for the access-requester (Slack handler) Lambda, creating a live alias and attaching API Gateway invoke permissions to the alias when enabled.

Removes the deprecated create_lambda_url/Lambda Function URL path (including related outputs/docs/examples), standardizing Slack integration on the API Gateway requester_api_endpoint_url output and updating API Gateway integration to target the alias ARN when provisioned concurrency is used.

Written by Cursor Bugbot for commit 44ebf97. This will update automatically on new commits. Configure here.

@Piccirello Piccirello marked this pull request as draft January 27, 2026 05:54
@Piccirello Piccirello force-pushed the no-more-cold-starts branch 2 times, most recently from ab376d0 to f9e193d Compare January 27, 2026 22:17
@Piccirello Piccirello marked this pull request as ready for review January 27, 2026 22:22
This has been deprecated since 1.4.0. Use of API gateway ensures request rate limits apply.
This can help reduce cold starts by keeping some number of lambdas provisioned.
@Piccirello
Copy link
Author

The cursor bot is finally happy 😭

@Piccirello Piccirello closed this Jan 30, 2026
@Piccirello Piccirello deleted the no-more-cold-starts branch January 30, 2026 23:39
@Piccirello Piccirello restored the no-more-cold-starts branch January 31, 2026 00:02
@Piccirello Piccirello reopened this Jan 31, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


revoker_lambda_arn = "arn:aws:lambda:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:function:${var.revoker_lambda_name}"
requester_lambda_arn = "arn:aws:lambda:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:function:${var.requester_lambda_name}"
requester_lambda_arn = var.slack_handler_provisioned_concurrent_executions > 0 ? "arn:aws:lambda:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:function:${var.requester_lambda_name}:live" : "arn:aws:lambda:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:function:${var.requester_lambda_name}"
Copy link

Choose a reason for hiding this comment

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

IAM self-invocation permission may fail with provisioned concurrency

Medium Severity

When provisioned concurrency is enabled, local.requester_lambda_arn includes the :live alias suffix. The IAM GetInvokeSelf statement (line 140) uses this ARN, so it only allows invocation of function:access-requester:live. If the Lambda code invokes itself using just the function name (e.g., via AWS_LAMBDA_FUNCTION_NAME), the invocation would target function:access-requester and be denied by IAM.

Additional Locations (1)

Fix in Cursor Fix in Web

@Andrey9kin
Copy link
Member

@Piccirello thanks for the PR we will look into it tomorrow

@Andrey9kin Andrey9kin self-assigned this Feb 3, 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.

2 participants

Comments