This project implements a distributed cloud pipeline to search for logs that are constantly being udated to S3 storage, and filter logs with specific characterteristics such as time intervals and Log Levels.
This project consists of multiple sub-modules that make up the overall root module. There are 3 modules namely
- GrpcRestLambda : A scala project that implements a lambda function which can handle requests in both GRPC as well as REST style.
- GrpcProto: A scala module that consists of the protobuf file. Compiling this project generated the required classes from the protobuf.
- AkkaService: An Akka service that implements two REST API calls that functions as a wrapper on the client side to re-directs any requests to the AWS API gateway.
Below are the steps that need to be followed in order to run the project
- Open the command prompt/terminal at the root directory of the project and run the command
sbt clean compile. This will compile all the modules in the project - If you need to compile a specific module run
sbt <Module-name>/compile - In order to create a fat jar of the GrpcRestLambda module inorder to be able to deploy the module, execute
sbt GrpcRestLambds/assembly - To run the Akka service in localhost, execute
sbt AkkaService/run
- Copy the fat jar generated by executing
sbt GrpcLambda/assemblyinto an s3 bucket. - Create a lambda function by selecting Java 8 as the runtime language.
- Once the Lambda function is created, within the code tab select upload -> from Amazon s3 -> In the dialog window paste the s3 link to the jar file and submit.
- Under Runtime setting make sure to specify the pacakge and the class that contains the handle request function that needs to be invoked by Lambda.
- Make sure to create appropriate IAM roles to allow lambda access rights to the s3 buckets.
- From the AWS console, navigate into the API Gateway service.
- Click on Create API -> Rest API
- Provide a name for the API and click on create
- Once create a directive and add a POST method to the api.
- Under the POST-setup select integration type to be Lambda Function, check 'Use Lambda Proxy integration'.
- Enter the URN of the lambda function in the field and click on create.
- Next under action click on Deploy API to deploy the api publicly
Once the above steps are complete. A unique api url will be provided using which post calls can be made to the lambda function via the API gateway.
Test cases have been written to test several util function used by the GrpcRestLambda module.
- To run tests open terminal in the project directory.
- run
sbt GrpcRestLambda/test. - check the status of all executed test cases.