0

I've created a Lambda function that will take a user's name and email and post those to an API. I then created an Aurora MySQL DB instance that will invoke that Lambda function. To invoke it, I created a trigger as such :

Time: AFTER
Event: Insert
Definition: BEGIN
CALL mysql.lambda_async("arn:aws:lambda:eu-west-2:<id-number>:function:user-to-API", CONCAT ('{"user_first_name": "', NEW.first_name, '", "user_email": "', NEW.email, '"}')); 
END
Definer: master_user@%

However, I want to do this synchronously, to trigger the lambda function only once. This is possible with an Aurora MySQL Native Function. However, I have tried without the mysql part - using lambda_sync and always receive the same error: MYSQL PROCEDURE mysql.lambda_sync does not exist OR MYSQL PROCEDURE lambda_sync does not exist. Does anyone have any experience with this?

Thank you in advance for your support.

2 Answers 2

2

Native functions are invoked with SELECT or DO -- CALL is used for stored procedures.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi @Michael, many thanks for your reply. Syntax is one issue and am grateful for clarifying that. Meanwhile, AWS replied that, quote: for a DB cluster created in Aurora MySQL 5.7 (Aurora MySQL 2.* version) the mysql.lambda_sync procedure is not supported. In Aurora MySQL 2.* version the use of native function technique as well as 'sync' lambda procedures is not supported. They have amended the documentation but it's still confusing. At the end of the day, however, I have no choice but to use calls to the mysql.lambda_async.
0

For everyone who faces the same issue as of 19 November 2018, according to AWS, the mysql.lambda_sync procedure is not supported for a DB cluster created in Aurora MySQL 5.7 (Aurora MySQL 2.* version). In Aurora MySQL 2.* version the use of native function technique as well as 'sync' lambda procedures is not supported. They have amended the documentation but it's still confusing. At the end of the day, however, I had to use calls to the mysql.lambda_async.

2 Comments

Sorry, mate, I can't because I don't work at that company anymore and the code is in one of their private repos. Unfortunately, I also don't remember it. Haven't used AWS ever since :(.
No worries, Turns out that Aurora Serverless which we are using does not support the feature of calling lambda functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.