Create a new Role from a Policy with the following permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"sqs:SendMessage",
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes"
],
"Resource": "*"
}
]
}
Create a Lambda from file #2 (using the new Role) and a second Lambda (also using the new Role) from either file #3 (SQS consumer, less requests) or file #4 (interval polling, deduplication).
Create a SES "Email Receiving" rule set that sends all inbounds for a particular email address to the Lambda from file #2.
If you chose file #3:
- Create a SQS queue with a visibility timeout of 9 seconds of type "Standard"
- Configure your Lambda to read from this queue
If you chose file #4:
- Create a SQS queue with a visibility timeout of 9 seconds of either type "Standard" or "FIFO" (if you choose "FIFO", you have additional options available to you in regards to deduplication)
- Configure a CloudWatch Event with a "Schedule expression" of
rate(5 minute)
, which will trigger the Lambda
Whether you chose file #3 or file #4, add the following environment variables to that Lambda:
SQS_QUEUE_NAME
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
TWILIO_SMS_FROM
(Twilio phone number formatted+15555555555
)TWILIO_SMS_GEOFENCE_TO
(JSON list of phone numbers formatted["+15555555555","+15555555556"]
)TWILIO_SMS_BATTERY_TO
(JSON list of phone numbers formatted["+15555555555"]
)
Add the following environment variables to for file #2:
SQS_QUEUE_NAME
Lastly, have your Trackimo alerts sent to the email address you setup with SES.