This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a sample Lambda function that records nanny check in/out activities | |
* in DynamoDB and sends SMS messages to the phone number on file. | |
* | |
* This function creates a DynamoDB table 'button_nanny_checkin' the first time | |
* it runs. The table uses button's DSN as hash key and timestamp as range key. | |
* Each entry has an activity message. | |
* | |
* If phone number is set, an SMS message about this check in/out activity will | |
* be sent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = dsn, uniqueid (hashkey for GSI), data (String/Blob) | |
console.log('Loading function'); | |
const AWS = require('aws-sdk'); | |
const dynamodb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = dsn | |
console.log('Loading function'); | |
const AWS = require('aws-sdk'); | |
const dynamodb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { |
OlderNewer