Skip to content

Fix: handle regions where Lambda Function URLs are not supported#1426

Open
RemyTinco wants to merge 1 commit intozappa:masterfrom
RemyTinco:master
Open

Fix: handle regions where Lambda Function URLs are not supported#1426
RemyTinco wants to merge 1 commit intozappa:masterfrom
RemyTinco:master

Conversation

@RemyTinco
Copy link
Contributor

Fixes #130

Summary

  • Wrap list_function_url_configs in delete_lambda_function_url() with a try/except for ClientError
  • If the API is unavailable in the region, return early since there are no Function URLs to delete

Problem

During zappa update, when function_url_enabled is not set, cli.py unconditionally calls delete_lambda_function_url(). In regions that don't support Lambda Function URLs (e.g. eu-south-2), the ListFunctionUrlConfigs API doesn't exist, causing an AccessDeniedException that aborts the entire deployment after the Lambda code has already been uploaded.

AWS docs confirming unsupported regions: https://docs.aws.amazon.com/lambda/latest/dg/urls-configuration.html

Change

File: zappa/core.pydelete_lambda_function_url()

The fix catches ClientError on the list_function_url_configs call and returns early. This is the only unguarded call site — all other list_function_url_configs calls in core.py and cli.py are behind if self.use_function_url checks.

Testing

Verified on eu-south-2 (Europe - Spain) deployment with function_url_enabled unset.

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.

[Migrated] Feature: store build info in archive, available to app code

1 participant