Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Amazon Aurora MySQL - Trigger to invoke AWS Lambda
DROP TRIGGER IF EXISTS TR_contacts_on_insert;
DELIMITER ;;
CREATE TRIGGER TR_contacts_on_insert
AFTER INSERT ON Contacts
FOR EACH ROW
BEGIN
SELECT NEW.email , NEW.fullname
INTO @Email , @Fullname;
lambda_async(
'arn:aws:lambda:REGION:ACCOUNT_ID:function:SendEmailWithContact',
CONCAT('{ "email" : "', Email, '", "fullname" : "', FullName, '"}')
);
END
;;
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.