Last active
November 24, 2017 04:44
-
-
Save johncmckim/91b77ef3e421de337dd823045e91982c to your computer and use it in GitHub Desktop.
Garden Aid - IoT Hub - serverless.yml
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
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)}} | |
# define the check moisture level function | |
functions: | |
checkMoistureLevel: | |
handler: index.checkMoistureLevel | |
resources: | |
Resources: | |
# DynamoDB - see https://gist.github.com/johncmckim/9bec3ee3ed07722eb1bd4335bcd80910 | |
# IoT - see https://gist.github.com/johncmckim/5d149fb2416f38957c2d0e30f56c6aba | |
LambdaInvokePermission: | |
Type: AWS::Lambda::Permission | |
Properties: | |
FunctionName: { Fn::GetAtt: [ checkMoistureLevel, Arn ] } | |
Action: lambda:InvokeFunction | |
Principal: iot.amazonaws.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment