Skip to content

Event Handler: ALB returns 502 for CORS Preflight configuration in ALBResolver #1248

Closed
@francispeabody

Description

@francispeabody

What were you searching in the docs?

This is either a bug or a documentation issue. I am looking at this section of the documentation. The way I read the documentation is that if cors_config is provided, powertools will automatically handle preflight 'OPTIONS' requests. In other words, you do not need to write and code to handle options requests as long as you provide a cors_config in the ALBResolver constructor. This does not appear to be the case. When fronting a lambda with an ALB, the preflight request fails, even if cors_config is provided, unless the options request is explicitly handled in the lambda code.

Is this related to an existing documentation section?

https://awslabs.github.io/aws-lambda-powertools-python/latest/core/event_handler/api_gateway/#pre-flight

How can we improve?

Clarification of the documentation for preflight requests for ALBs specifically. Also a code example of how to handle preflight requests for a lambda fronted by and ALB would be nice. Thanks!

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions