exam questions

Exam AWS Certified SysOps Administrator - Associate All Questions

View all questions & answers for the AWS Certified SysOps Administrator - Associate exam

Exam AWS Certified SysOps Administrator - Associate topic 1 question 233 discussion

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?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Christina666
Highly Voted 9 months, 1 week ago
Selected Answer: A
When a Lambda function is used as a target for an EventBridge (CloudWatch Events) rule, it requires permission to be invoked by the rule. By default, Lambda functions do not have permission to be invoked by EventBridge rules. To enable the Lambda function to be triggered by the EventBridge rule, the SysOps administrator must add an appropriate permission to the Lambda function's execution role.
upvoted 8 times
Christina666
9 months, 1 week ago
Option B (Change the lifecycle hook action to CONTINUE if the lifecycle hook experiences a failure or timeout) is not the correct option. Changing the lifecycle hook action to CONTINUE will not address the issue of the Lambda function not being invoked. Option C (Configure a retry policy in the EventBridge (CloudWatch Events) rule to retry the Lambda function invocation upon failure) is not the correct option either. While configuring a retry policy could be useful for handling transient failures, it will not help if the underlying issue is that the Lambda function does not have permission to be invoked by the EventBridge rule. Option D (Update the Lambda function execution role so that it has permission to call the complete-lifecycle-action event) is not the correct option. The "complete-lifecycle-action" event is not related to the Lambda function execution role. The main issue is that the Lambda function is not being triggered by the EventBridge rule, so updating the execution role will not resolve the problem.
upvoted 3 times
...
...
mana25
Most Recent 9 months ago
Selected Answer: D
https://docs.aws.amazon.com/autoscaling/ec2/userguide/tutorial-lifecycle-hook-lambda.html Option D
upvoted 1 times
cerepx
6 months, 3 weeks ago
Option D is incorrect, it would be correct only if Lambda would have been invoked successfully by EventBridge. However, according to the statement: "In testing, the SysOps administrator discovers that the Lambda function is not invoked when the EC2 instances auto scale." Hence, Option A is the correct answer.
upvoted 4 times
...
...
trvtrinh
9 months, 1 week ago
A is true
upvoted 1 times
...
jas26says
9 months, 3 weeks ago
Selected Answer: A
It's A because the function can't be invoked.
upvoted 2 times
...
ctd983
9 months, 4 weeks ago
Selected Answer: A
A is correct
upvoted 2 times
...
AShahine21
10 months ago
I have to give permission to lambda to be executed by EventBridge ? It's D
upvoted 1 times
...
Vivec
1 year, 1 month ago
Selected Answer: 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.
upvoted 4 times
cerepx
6 months, 3 weeks ago
Option D is incorrect, it would be correct only if Lambda would have been invoked successfully by EventBridge. However, according to the statement: "In testing, the SysOps administrator discovers that the Lambda function is not invoked when the EC2 instances auto scale." Hence, Option A is the correct answer.
upvoted 1 times
...
...
csG13
1 year, 1 month ago
Selected Answer: A
I choose A - from the description, looks like that CloudWatch is not able to invoke lambda, not that lambda has not permissions to complete lifecycle action. Thus the problem should be in lambda’s execution role.
upvoted 2 times
...
braveheart22
1 year, 1 month ago
D is the right answer. To allow Lambda to signal Amazon EC2 Auto Scaling when the lifecycle action is complete, you must add the CompleteLifecycleAction API call to the function code. You must also have attached an IAM policy to the function's execution role that gives Lambda permission to complete lifecycle actions. https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html
upvoted 2 times
...
SomboonCH
1 year, 1 month ago
Selected Answer: 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
upvoted 3 times
...
bbfd465
1 year, 2 months ago
Selected Answer: A
A is the answer
upvoted 2 times
...
Agil09
1 year, 2 months ago
Selected Answer: A
Agree with A
upvoted 2 times
...
Gil80
1 year, 2 months ago
Selected Answer: 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.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago