WebsocketEvent::getRegion
is incompatible with custom domain names.
#1593
Labels
WebsocketEvent::getRegion
is incompatible with custom domain names.
#1593
Description:
Bref\Event\ApiGateway\WebsocketEvent
has a methodgetRegion()
that should return the current AWS region e.g.eu-west-1
This is implemented by parsing it out of the
domainName
from the eventrequestContext
.This makes sense only in the case that default AWS provided API gateway domains are used. When you set up your own domain for the websocket API you end up getting a segment of that domain returned as your region.
For example if you have a domain configured of
websocket.example.org
the AWS region returned by this method would beorg
which isn't correct.Hope that makes sense, it's a fairly straightforward one but happy to provide more context if needed. I'm not sure if it's a good solution but the current region is available in Lambda via an environment variable.
The below resolves it for me:
The text was updated successfully, but these errors were encountered: