You are using an AWS CodePipeline to create a CloudFormation stack.
The stack is used to deploy resources for a human approval project that allows the execution of a state machine to pause during a task.
The workflow continues to the next state once the user has approved the task.
In the CloudFormation template, there are already resources including Lambda functions that send email links for approval, an API Gateway endpoint that triggers Lambda functions and an SNS topic that sends an email for approval.
What is another key resource that needs to be created in the template?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer - C.
In this question, the workflow progresses to the next state after the user has approved the task.
It can be implemented with a state machine.
For an example of creating a human approval project, check the document in.
https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-human-approval.html.Option A is incorrect: Because for Step Function state machine resources in CloudFormation template, the correct type should be AWS::StepFunctions::StateMachine.
The reference is in.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html.Option B is incorrect: Because there are no such type AWS::SWFFunctions.
SWF is not supported in CloudFormation.
Option C is CORRECT: Because the Step Function state machine is a key resource in this case which achieves the feature of manual approval during a running task.
Option D is incorrect: Similar reason as option.
B.
The key resource that needs to be created in the CloudFormation template to support the human approval project is a Step Function resource created in the type AWS::StepFunctions::StateMachine.
A Step Function is a fully managed service that lets you coordinate distributed applications and microservices using visual workflows. It allows you to define a state machine, which is a collection of states that describe how to handle input, make decisions, and perform actions.
In this case, the state machine would include a "Wait for Approval" state, which pauses the execution of the workflow until the user approves the task. Once the approval is received, the state machine would move on to the next state.
The CloudFormation template already includes resources for Lambda functions that send email links for approval, an API Gateway endpoint that triggers Lambda functions, and an SNS topic that sends an email for approval. These resources work together to initiate the approval process and notify the user when there is a task that requires approval.
To integrate the approval process with the state machine, a Step Function resource needs to be created. This resource defines the state machine and specifies how the different states in the machine interact with each other.
Option A, a state machine resource created in the type of AWS::StepFunctions::Activity, is incorrect because AWS::StepFunctions::Activity is a type of state that represents a single unit of work within a state machine. It is not the type of resource used to create a state machine.
Option B, a SWF state machine resource configured in AWS::SWFFunctions::StateMachine, is also incorrect. AWS SWF (Simple Workflow Service) is an older service that has largely been replaced by AWS Step Functions. Therefore, it is unlikely that this would be the correct answer.
Option D, a SWF resource in the CloudFormation type AWS::SWFFunctions::Activity, is also incorrect because it is not the correct resource type for creating a state machine. Additionally, as mentioned earlier, AWS SWF is not the recommended service for this use case.
In summary, the correct answer is C, a Step Function resource created in the type AWS::StepFunctions::StateMachine, because it creates a state machine that integrates the approval process with the existing resources in the CloudFormation template.