Skip to content

sergejsvisockis/invoice-notification-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invoice notification

This is a simple AWS Lambda function which is supposed to be enabled by cron and periodically run in the AWS. It will scan an inbox on whether that contains a new mails and based on that sending an SNS message into the SNS topic and further on as an SMS.

Deployment

  1. Follow these steps and name a zip archive like this - invoice-notification-function.zip

  2. Create an IAM role

aws iam create-role \
--role-name invoice-notification-lambda \
--assume-role-policy-document file://trust-policy.json
  1. Grant full access to an SNS for that role
aws iam put-role-policy \
--role-name invoice-notification-lambda \
--policy-name LambdaSNSFullAccess \
--policy-document file://sns-full-access.json
  1. Deploy Lambda function
aws lambda create-function --function-name invoice-notification-function \
--runtime python3.13 --handler lambda_function.lambda_handler \
--role arn:aws:iam::117863533677:role/invoice-notification-lambda \
--zip-file fileb://invoice-notification-function.zip
  1. Add all the necessary environment variables
aws lambda update-function-configuration \
--function-name invoice-notification-function \
--environment "Variables={TOPIC_ARN=VALUE,IMAP_SERVER=VALUE,IMAP_PORT=VALUE,LEASE_EMAIL=VALUE,SALARY_EMAIL=VALUE,USERNAME=VALUE,PASSWORD=VALUE}"
  1. Add a trigger in the EventBridge. That could be done in the AWS Console UI within the Lambda configuration.

  2. Create a new SNS topic:

aws sns create-topic --name invoice-notification
  1. Create a subscription via the SMS, email, etc.

About

Invoice notification AWS Lambda function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages