aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Using a pre existing function for auth triggers #2936

Closed Jkap7788 closed 4 years ago

Jkap7788 commented 4 years ago

Hi,

Is it possible to use a pre-existing lambda function as an auth trigger (e.g preSignup, postConfirmation, etc.)

Currently, the cli will create a lambda function under the function category.

Would we be able to override this behaviour by supplying a lambda arn to use instead?

Thanks!

Which Category is your question related to? Auth

Amplify CLI Version 3.17

kaustavghosh06 commented 4 years ago

@Jkap7788 This is not currently supported out of the box, but you can take a look at the Auth cloudformation template and replace the postConfirmation attribute to your custom function name (which is outside of the Amplify project)

Jkap7788 commented 4 years ago

@kaustavghosh06 Thanks for the reply, will probably migrate over to a function managed by the cli, I'm wary of changing the auth template manually as my changes may be overwritten in the future.

Thanks!

ChristopheBougere commented 4 years ago

I am currently using lambdas deployed with Serverless for my custom AppSync resolvers, and it works well. It is quite easy to define the lambda name using the ${env} variable: @function(name: "serviceName-${env}-lambdaName").

It would be very useful to have the same capability for lambda triggers.

@Jkap7788 @kaustavghosh06 Could we reopen this issue, and mark it as a feature request?

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.