Name: anno-lambda-preview
Owner: NPR visuals team
Description: AWS lambda function that generates the anno-docs preview
Created: 2017-02-23 11:03:51.0
Updated: 2017-02-24 20:01:06.0
Pushed: 2018-03-01 01:01:46.0
Homepage: null
Size: 17
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
AWS lambda function that generates the anno-docs preview, its main purpose if to offer a more autonomous way of previewing annotations on the editorial side.
This is a work in progress repo.
The following things are assumed to be true in this documentation.
For more details on the technology stack used with the app-template, see our development environment blog post.
The project contains the following folders and important files:
code
– Where are lambda function code livestest
– local tests to check that our code runs locallyfabfile.py
– Fabric commands for automating setup and deploymentrequirements.txt
– Python requirements.Create a lambda function inside AWS using the AWS Console and write down the name you gave to that function and
Also write down the name ot the handler you used.
For example if you have used lambda.lambda_handler
then you will need to create a file on code
called lambda.py
that should have a function with name lambda_handler
in it, that receives as arguments an event
and a context
. That will be the entry point for your lambda execution.
To bootstrap the project:
nno-lambda-preview
rtualenv anno-lambda-preview
install -r requirements.txt
code/requirements.txt
Since some of the code on this repo should be identical to that of the origin anno-docs repo there's a fabric task that will grab the latest pushed files from master
and place them in their corresponding place in the code
folder. To sync those files run manually:
sync_anno_docs_files
Create a function in your AWS lambda environment.
Finally run:
deploy:function=FUNCTION_NAME
Where FUNCTION_NAME
is the name of the created lambda function
The deploy function automatically invokes the sync task mentioned above.