You have an existing AWS setup with DirectConnect.
You have migrated certain on premise backend applications to AWS EC2 instances which are having certain processes run based on triggers from other applications.
These processes are developed on JAVA programming language.
Your organization is looking to migrate these processes to Lambda and reduce the cost incurred on EC2 instances.
What would be your recommendation?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: B.
You can invoke a Lambda function using a custom event through AWS Lambda's invoke API.
Only the function's owner or another AWS account that the owner has granted permission can invoke the function.
https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html https://docs.aws.amazon.com/lambda/latest/dg/with-userapp.htmlThe best recommendation would be option B: Replicate the Java code easily onto AWS Lambda function with few modifications and use Lambda Invoke API with input passed as custom event.
AWS Lambda is a serverless computing service that allows developers to run code without having to worry about managing servers. It supports a variety of programming languages, including Java, and can be triggered by AWS supported event sources, including AWS services like S3, DynamoDB, and others.
To migrate the processes developed on Java programming language to Lambda, the first step would be to replicate the code into a Lambda function. This can be done with few modifications to ensure the code works well with the serverless environment.
Once the code is in the Lambda function, it can be invoked using the Lambda Invoke API. This API allows custom events to be passed as input to the function. In this case, the triggers from other applications can be used as custom events to invoke the Lambda function and run the processes.
This approach can help reduce costs incurred on EC2 instances as Lambda is a pay-per-use service, which means that you only pay for the amount of compute time your code consumes, and there are no upfront costs or minimum fees.
Option A is incorrect because Lambda can be invoked from a custom application using the Lambda Invoke API.
Option C is incorrect because triggering Lambda from AWS CloudWatch scheduled events and invoking CloudWatch API from the applications would not be the best approach as it requires additional steps and complexity.
Option D is incorrect because Lambda is designed to run backend applications and can be a more cost-effective and scalable solution compared to using EC2 instances.