Skip to content

Project that creates an API with lambda, send data to a Inbound Kinesis, that triggers another lambda and send the data to an Outbound Kinesis

Notifications You must be signed in to change notification settings

lara-clink/lambda_kinesis_stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kinesis Stream with Lambda and API

Project that creates an API using lambda and API Gateway, recieve data from user, checks if the field 'user_timespent' is correct (not 0 or nullable) and send the data to the Inboud Kinesis (sender) that triggers a process lambda function which decodes the base64 data and send it to the Outbound Kinesis (reciever).

Files Description

  • cloudformation
    • cf_main_scope.yaml: CloudFormation template that provides all of the infrastrucure that is required for running the application. It provides the API Gateway configs, the lambdas, Inbound Kinesis, Outbound Kinesis and Roles with policies to allow the necessary permissions. All of the lambda codes are already in the CloudFormation so it is not necessary to zip everthing and upload on a AWS S3 Bucket.
  • src: Lambda codes
    • api_lambda.py
    • process_lambda.py

How to use it

You can upload the yaml code in the console in AWS CloudFormation or run the command line (make sure you are logged in your profile):

aws cloudformation deploy --template-file /path_to_template/cf_main_scope.yaml --stack-name kinesis-lambda

In case of any doubt see the AWS CloudFormation Documentation.

After the stack is created, go to resources to get the API Gateway post link. You can run it with Postman sending the data in the body section or even testing in the console in the test link in API Gateway. Sometimes it can have a Proxy error, just make sure in the API Gateway that the Lambda Proxy is enable.

Application Diagram

Application Diagram

About

Project that creates an API with lambda, send data to a Inbound Kinesis, that triggers another lambda and send the data to an Outbound Kinesis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages