Add AWS lambda lib

This commit is contained in:
2020-04-29 22:14:46 -04:00
parent 6bc9eb351b
commit 9d0d6ccf8a
7 changed files with 56 additions and 4 deletions

2
.gitignore vendored
View File

@@ -128,6 +128,6 @@ fabric.properties
resouces/facts.txt
secrets.yaml
secrets.local
resources/facts.txt

View File

@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.7 (groupme-facts-bot)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">

2
.idea/misc.xml generated
View File

@@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (avan-facts)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (groupme-facts-bot)" project-jdk-type="Python SDK" />
</project>

39
config.yaml Normal file
View File

@@ -0,0 +1,39 @@
region: us-east-1
function_name: avan_facts_bot
handler: service.handler
description: Random Avan facts vis groupme
runtime: python3.8
# role: lambda_basic_execution
# S3 upload requires appropriate role with s3:PutObject permission
# (ex. basic_s3_upload), a destination bucket, and the key prefix
# bucket_name: 'example-bucket'
# s3_key_prefix: 'path/to/file/'
# if access key and secret are left blank, boto will use the credentials
# defined in the [default] section of ~/.aws/credentials.
aws_access_key_id: ${AWS_TOKEN_ID}
aws_secret_access_key: ${AWS_TOKEN}
# dist_directory: dist
# timeout: 15
# memory_size: 512
# concurrency: 500
#
# Experimental Environment variables
environment_variables:
BOT_NAME: ${BOT_NAME}
GROUPME_KEY: ${GROUPME_KEY}
# If `tags` is uncommented then tags will be set at creation or update
# time. During an update all other tags will be removed except the tags
# listed here.
#tags:
# tag_1: foo
# tag_2: bar
# Build options
build:
source_directories: lib # a comma delimited list of directories in your project root that contains source to package.

4
event.json Normal file
View File

@@ -0,0 +1,4 @@
{
"pi": 3.14,
"e": 2.718
}

View File

@@ -1,2 +1,3 @@
GroupyAPI
pytest
pytest
python-lambda

8
service.py Normal file
View File

@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
def handler(event, context):
# Your code goes here!
e = event.get("e")
pi = event.get("pi")
return e + pi