You have a task to build the AWS infrastructure resources for a project.
In this project, there is a high-volume event source in an Amazon SQS queue.
Certain steps are needed to process the messages.
You want to implement a state machine and visualize the workflow.
The AWS resources should be managed by a configuration orchestration tool so that they can be redeployed easily in another environment.
Which tools should you use for this task?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer - B.
The State Machine with Lambda tasks for Step Functions can be implemented using CloudFormation.
The reference can be found in https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-lambda-state-machine-cloudformation.html.
Option A is incorrect: Because Elastic Beanstalk is not appropriate for Step Functions or Lambda functions.
CloudFormation should be used as an infrastructure management tool.
Option B is CORRECT: Because CloudFormation can set up resources such as Lambda function (AWS::Lambda:: Function) and Step Functions state machine (AWS::StepFunctions:: StateMachine) in a single template.
Therefore we create a state machine with some lambda tasks to visualize the workflow.
Option C is incorrect: Similar to option A, OpsWorks is not a suitable tool for Step Functions.
CloudFormation should be chosen.
Option D is incorrect: Because it is incorrect to put each Lambda function in a separate Lambda layer.
This is not how Lambda layers work.
Details please check https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html.
The best answer for this question is option B: Create a State Machine with Lambda tasks using AWS CloudFormation templates.
Here's why:
Amazon Simple Queue Service (SQS) is a managed message queue service that can be used to decouple and scale microservices, distributed systems, and serverless applications. It allows you to send, receive, and process messages asynchronously. In this scenario, there is a high-volume event source in an Amazon SQS queue, and certain steps are needed to process the messages.
AWS Step Functions is a fully managed service that makes it easy to coordinate the components of distributed applications and microservices using visual workflows. It allows you to build applications from individual building blocks using a graphical console. In this scenario, you want to implement a state machine and visualize the workflow.
AWS CloudFormation is a service that provides a common language for you to describe and provision all the infrastructure resources in your cloud environment. It allows you to automate the creation, update, and deletion of your AWS resources. In this scenario, the AWS resources should be managed by a configuration orchestration tool so that they can be redeployed easily in another environment.
Option A is incorrect because Elastic Beanstalk is a platform-as-a-service (PaaS) that allows you to deploy web applications and services on popular languages and frameworks. It is not the best fit for processing messages from an SQS queue using a state machine.
Option C is incorrect because AWS OpsWorks is a configuration management service that provides managed instances of Chef and Puppet. It is not the best fit for implementing Step Functions that pull messages from an SQS queue and process messages in a state machine.
Option D is incorrect because creating a separate Lambda layer for each Lambda function is not the best practice. A Lambda layer is a distribution mechanism for libraries, custom runtimes, and other function dependencies. It is not the best fit for creating a state machine with Lambda tasks using AWS CloudFormation templates.
In conclusion, the best answer is option B because it allows you to create a state machine with Lambda tasks using AWS CloudFormation templates, which is the best fit for implementing a high-volume event source in an Amazon SQS queue and visualizing the workflow using a state machine.