AWS Certified SysOps Administrator – Associate — Question 157
A SysOps administrator must ensure that a company's Amazon EC2 instances auto scale as expected. The SysOps administrator configures an Amazon EC2 Auto Scaling lifecycle hook to send an event to Amazon EventBridge (Amazon CloudWatch Events), which then invokes an AWS Lambda function to configure the EC2 instances. When the configuration is complete, the Lambda function calls the complete-lifecycle-action event to put the EC2 instances into service. In testing, the SysOps administrator discovers that the Lambda function is not invoked when the EC2 instances auto scale.
What should the SysOps administrator do to resolve this issue?
Answer options
- A. Add a permission to the Lambda function so that it can be invoked by the EventBridge (CloudWatch Events) rule.
- B. Change the lifecycle hook action to CONTINUE if the lifecycle hook experiences a failure or timeout.
- C. Configure a retry policy in the EventBridge (CloudWatch Events) rule to retry the Lambda function invocation upon failure.
- D. Update the Lambda function execution role so that it has permission to call the complete-lifecycle-action event.
Correct answer: A
Explanation
The correct answer is A because the Lambda function needs explicit permission to be invoked by the EventBridge rule. Without this permission, the function will not execute when the event is triggered. The other options address different aspects of the lifecycle hook or Lambda function execution but do not resolve the issue of invocation permissions.