Topic 1 Question 233
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?
Add a permission to the Lambda function so that it can be invoked by the EventBridge (CloudWatch Events) rule.
Change the lifecycle hook action to CONTINUE if the lifecycle hook experiences a failure or timeout.
Configure a retry policy in the EventBridge (CloudWatch Events) rule to retry the Lambda function invocation upon failure.
Update the Lambda function execution role so that it has permission to call the complete-lifecycle-action event.
ユーザの投票
コメント(7)
- 正解だと思う選択肢: A
To allow the EventBridge (CloudWatch Events) rule to invoke the Lambda function, the function's execution role needs to have the necessary permissions to be invoked by the rule. Specifically, the execution role needs to have an event pattern that matches the rule and an IAM policy that grants the necessary permissions to execute the Lambda function. By adding the necessary permissions to the Lambda function, the SysOps administrator can ensure that the function is invoked when the EC2 instances auto scale.
Option D is incorrect because updating the Lambda function execution role so that it has permission to call the complete-lifecycle-action event will not address the issue of the Lambda function not being invoked by the EventBridge (CloudWatch Events) rule.
👍 4Vivec2023/03/09 - 正解だと思う選択肢: D
D is correct, Before you create a Lambda function, you must first create an execution role and a permissions policy to allow Lambda to complete lifecycle hooks. https://docs.aws.amazon.com/autoscaling/ec2/userguide/tutorial-lifecycle-hook-lambda.html
👍 3SomboonCH2023/03/03 - 正解だと思う選択肢: A
A seems like the first step to check. "When creating an EventBridge rule with a Lambda function as the target, keep the following in mind:
When using the EventBridge console to create the rule, the appropriate permissions are added to the function's resource policy automatically. When using the AWS CLI, SDK, or AWS CloudFormation to create the same rule, you must manually apply the permissions in the resource policy. The permissions grant the Amazon EventBridge service access to invoke the Lambda function."
source: https://aws.amazon.com/premiumsupport/knowledge-center/eventbridge-lambda-not-triggered/
However, I'm not 100% sure. This still needs more validation.
👍 2Gil802023/02/13
シャッフルモード