Skip to content

zaknuces/cloudFunction-Round2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudFunction-Round2

This codebase is created to experiment with AWS Lambda. The goal is to use SAM to deploy and publish the lambda function using Cloud formation.

Setup

Package

Run the following command to package the local artifacts (defined in template.yaml file) and upload them to S3 bucket and create a new template file with references to S3 bucket.

sam package --template-file template.yaml --s3-bucket mybucket --output-template-file output.yaml

Deploy

Run the following command to create and execute changeset as described in the cloud formation template (output.yaml).

sam deploy --template-file ./output.yaml --stack-name mystack --capabilities CAPABILITY_IAM

Unit Tests

Run "npm test" to execute unit tests

Functional Tests

Generate S3 event using:

sam local generate-event s3 --bucket localTestBucket --key test-key > event_file.json

sam local invoke AddReviewDocumentToList -e event_file.json

About

Cloud Function using SAM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published