AWS Lambda Functions

With the addition of Create AWS Lambda Function in Tasks , users will be able to create templates of AWS Lambda Functions through Opsera Tasks and allow them to deploy them live via the Opsera Pipeline.

AWS Lambda Service workflow requires setup in both Tasks and Pipeline. The workflow is separated into two parts where the user enters certain static information in the Tasks page and then links the task to the respective step in the pipeline.

Task Setup Instructions:

  1. To create an AWS Lambda Function Task template, navigate to Tasks and select + New Task button. In the Type drop down, click on AWS Lambda Function Creation.

2. Fill in the field values required for task template creation:

  • AWS Tool - Select an AWS Tool.

  • Function Name - Create a unique name for the function. To confirm that the name is unique and does not exist in AWS yet, click the Validate button. If it already exists user will receive error:

  • Handler - Follow the example syntax to create. (Example for Java 8: example.Hello::handleRequest)

  • IAM Role - Fetched from AWS.

  • Runtime - Select the language to write the function. Java 8 is supported at this time.

3. Select the Save button to save the task template.

Once the templates are created the user can create and deploy the functions via the opsera pipeline.

Pipeline Setup Instructions:

Note: To set up a Lambda pipeline, there are 3 steps required in the workflow:

  • Maven Build - Uses Jenkins Tool.

  • S3 Push - Uses Publish to S3 Tool.

  • Publish AWS Lambda - Uses Publish AWS Lambda Tool.

After configuring the first two steps (Maven Build and S3 Push) the user can move on to configuring the AWS Lambda step.

  1. Select the gear icon in the Publish AWS Lambda step to open Step Configurations.

2. Select the proper values fields and Save:

  • Action - Select Create from the drop down to trigger function creation.

  • AWS Tool - Select the AWS Tool that matches the tool used in template creation in Tasks.

  • Lambda Function ↔︎ S3 Push Mapping - Select the Lambda function templates and map it to the respective s3 step(s).

    • Select Lambda Function - Select the Lambda function templates created in Tasks.

    • Select S3 Push Step - Select the S3 Push Step to map the function to. If the user has one s3 step and multiple functions - the user can map out multiple functions to one s3 step. Alternatively if the user has multiple functions and multiple s3 steps, the user can also map out the functions to their individually intended s3 steps.

Pipeline Logs

As the pipeline runs the user will get logs regarding the success for failure of each function that the user is trying to create. To view them, navigate to the Summary tab and view Pipeline Logs table. Logs will generate a message per each function that has been created


Frequently Asked Questions

 

Question

Answer

 

Question

Answer

1

What are the possibilities that the handler of a given lambda function will get updated ?

  • Case 1: User created a function and has a typo mistake in Handler , So user realizes and will update the handler.

  • Case 2: User wants to map the lambda function with a different handler.

Note: Handler is nothing but a function or a method with complete path for a runtime ( eg: java)

2

How many handlers can be mapped to one function ?

One function will always map to one handler [ 1-1 mapping]

3

How many lambda functions can be created from one source ( eg: jar file) ?

Can create as many number of the functions , all functions will be pointed to the same source.

4

How does the data Flow ?

  • Step 1: Connect to maven repo and build a jar file

  • Step 2: Push the jar file to S3 location

    • Pass bucket and artifacts details from Step2 to Step3

  • Step 3: Use s3 location and fill the data in step form

    • Persist the data in mongoDB and stream to Kafka Topic during runtime

    • Application listens kafka topic && Create Function through async process and post the status to kafka topic



 

 

 



 



            

Â