Keybase proof
I hereby claim:
- I am johncmckim on github.
- I am johncmckim (https://keybase.io/johncmckim) on keybase.
- I have a public key ASA3Auj6jyN4fFD4UjSQ2XJMWdfYLDiptLs-FWB23bkK6wo
To claim this, I am signing this object:
{ | |
"dependencies": { | |
"aws-sdk": "^2.7.10", | |
"bluebird": "^3.4.6", | |
"lodash": "^4.17.2", | |
"moment": "^2.17.1" | |
} | |
} |
'use strict'; | |
const BbPromise = require('bluebird'); | |
const path = require('path'); | |
const logger = require('./logger'); | |
const processor = require('./processor'); | |
const rekognition = require('./rekognition'); | |
const BUCKET_NAME = process.env.BUCKET_NAME; |
service: serverless-emoticon-faceswap | |
provider: | |
name: aws | |
runtime: nodejs4.3 | |
# Allow Lambda to access Rekognition and S3 | |
iamRoleStatements: | |
- Effect: Allow | |
Action: | |
- rekognition:DetectFaces | |
Resource: '*' |
I hereby claim:
To claim this, I am signing this object:
const awsIot = require('aws-iot-device-sdk'); | |
const interval = 1000 * 60 * 1; // one minute | |
const device = awsIot.device({ | |
keyPath: './path/to/your/private.pem.key', | |
certPath: './path/to/your/certificate.pem.crt', | |
caPath: './path/to/your/verisign-ca.pem', | |
clientId: 'garden-aid-client-test-js', | |
region: 'ap-southeast-2' |
service: garden-aid-iot-hub | |
provider: | |
name: aws | |
runtime: nodejs4.3 | |
# custom variable syntax is needed to avoid conflits with aws cloudformation functions | |
variableSyntax: '\${{([\s\S]+?)}}' | |
# load custom variables from a file | |
custom: ${{file(./vars-${{opt:stage}}.yml)}} |
SensorThing: | |
Type: AWS::IoT::Thing | |
Properties: | |
AttributePayload: | |
Attributes: | |
SensorType: soil | |
SensorThingPolicy: | |
Type: AWS::IoT::Policy | |
Properties: |
MoistureData: | |
Type: AWS::DynamoDB::Table | |
DeletionPolicy: Retain | |
Properties: | |
TableName: moisture-data-${{opt:stage}} | |
AttributeDefinitions: | |
- | |
AttributeName: ClientId | |
AttributeType: S | |
- |
const BbPromise = require('bluebird'); | |
const rp = require('request-promise'); | |
module.exports.notify = (event, context, cb) => { | |
const promises = []; | |
event.Records.forEach(function(record) { | |
if(record.EventSource !== 'aws:sns') { | |
console.warn('Recieved non sns event: ', record); |
const AWS = require('aws-sdk'); | |
const sns = new AWS.SNS(); | |
// Example event | |
// { DeviceId: 'test-js-device', Recorded: '2016-08-14T12:39:06.765Z', Level: 3.59334681998007 } | |
module.exports.checkLevel = (event, context, cb) => { | |
if(event.Level >= 2.5) { | |
cb(null, { message: 'No message to publish', event: event }); |