-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to reference an existing authorizer function for ApiGatewayV1 #4058
Comments
@srenault If u have an existing lambda authorizer with id ie. const api = new sst.aws.ApiGatewayV1("MyApi");
api.route("GET /token", "index.handler", {
auth: { custom: "xxxx" },
}); u don't need to call lemme know if this works for u. |
My understanding is I need to create for each ApiGateway a new authorizer that all point to the same lambda authoriser so I don't think it would work. |
Im also hitting this issue - when trying to create a Cognito authorizer I'm getting the It appears to be caused by sst/ion@6d6a782 - it changes line 130 in authorizerUri: fn?.nodes.function.invokeArn, to: authorizerUri: fn!.nodes.function.invokeArn, Note removal of the optional chaining operator. When creating a Cognito authorizer, no lambda is created, so |
Has anyone from the project got time to look at my PR please? I've not contributed before so am not sure of the process, but it's a one-liner and should be quick to review 😄 |
Currently I don't see anyway to reference an existing function when adding a new authorizer to
ApiGatewayV1
.I tried to pass the
arn
instead of the handler path without any success.Another attempt I had was to use the
userPools
method (because I saw it's the only case where SST doesn't create a lambda) and use the transform function to updateauthorizerUri
. But it ended up with the following error :Finally I came up with following solution:
In this solution I let SST creating the lambda even though I don't use it.
Is there anything I'm missing here?
Also I'm pretty sure I spot a bug with
userPools
as well.The text was updated successfully, but these errors were encountered: