amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Using a pre existing function for auth triggers

Open Jkap7788 opened this issue 6 years ago • 4 comments

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

Jkap7788 avatar Dec 06 '19 08:12 Jkap7788

@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)

kaustavghosh06 avatar Dec 10 '19 18:12 kaustavghosh06

@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!

Jkap7788 avatar Dec 12 '19 02:12 Jkap7788

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?

ChristopheBougere avatar Mar 20 '20 20:03 ChristopheBougere

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.

github-actions[bot] avatar May 26 '21 13:05 github-actions[bot]