exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 396 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 396
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company is running Amazon EC2 instances in multiple AWS accounts. A developer needs to implement an application that collects all the lifecycle events of the EC2 instances. The application needs to store the lifecycle events in a single Amazon Simple Queue Service (Amazon SQS) queue in the company's main AWS account for further processing.

Which solution will meet these requirements?

  • A. Configure Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account. Add an EventBridge rule to the event bus of the main account that matches all EC2 instance lifecycle events. Add the SQS queue as a target of the rule.
  • B. Use the resource policies of the SQS queue in the main account to give each account permissions to write to that SQS queue. Add to the Amazon EventBridge event bus of each account an EventBridge rule that matches all EC2 instance lifecycle events. Add the SQS queue in the main account as a target of the rule.
  • C. Write an AWS Lambda function that scans through all EC2 instances in the company accounts to detect EC2 instance lifecycle changes. Configure the Lambda function to write a notification message to the SQS queue in the main account if the function detects an EC2 instance lifecycle change. Add an Amazon EventBridge scheduled rule that invokes the Lambda function every minute.
  • D. Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
KT_Yu
Highly Voted 2 years, 3 months ago
Selected Answer: D
Ans: D. Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule.
upvoted 5 times
KT_Yu
2 years, 3 months ago
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html
upvoted 1 times
KT_Yu
2 years, 3 months ago
I think the big difference between B and D is that D utilizes a central event bus in the main account while D sends events to SQS directly from different accounts. This is my best interpretation.
upvoted 1 times
KT_Yu
2 years, 3 months ago
the second I mean B* hope it helps ;)
upvoted 1 times
...
...
...
...
shahs10
Most Recent 2 years, 1 month ago
Selected Answer: B
For Option C using lambda does not seem to be a good solution as we would have to trigger lambda on some schedule and it will has less granularity in time. For D. Why would we be matching EC2 instance lifecycle events in Main account event bus and not in each account event bus and reducing overhead for main account
upvoted 1 times
...
DrDopey
2 years, 2 months ago
Selected Answer: B
This solution uses resource policies to give permissions to all AWS accounts to write to the SQS queue in the main account. This way, EC2 instances in any account can send their lifecycle events to the SQS queue in the main account. Additionally, each account will have an EventBridge rule that matches all EC2 instance lifecycle events and sends them to the SQS queue in the main account. This solution meets the requirement of storing all the lifecycle events of EC2 instances from multiple accounts in a single Amazon SQS queue for further processing.
upvoted 1 times
...
Drey
2 years, 2 months ago
Selected Answer: A
The best solution would be to use Amazon EventBridge and have each account deliver the EC2 instance lifecycle events to the EventBridge event bus of the main account. Then, set up a rule in the main account's event bus that matches all EC2 instance lifecycle events and set the SQS queue as a target for the rule. This solution provides a direct and efficient mechanism for collecting the EC2 instance lifecycle events and eliminates the need for a periodic scan by the Lambda function.
upvoted 2 times
...
JagpreetLM10
2 years, 3 months ago
Selected Answer: A
Configure Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account. Add an EventBridge rule to the event bus of the main account that matches all EC2 instance lifecycle events. Add the SQS queue as a target of the rule. In order to meet the requirements, the developer can use the EventBridge service. By configuring Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the EventBridge event bus of the main account, the developer can create an EventBridge rule in the main account that matches all EC2 instance lifecycle events and add the SQS queue as a target of the rule. This way, all the lifecycle events of the EC2 instances will be collected and stored in a single SQS queue in the main account for further processing.
upvoted 2 times
...
Phinx
2 years, 3 months ago
Selected Answer: D
I think it's D as well. All other options doesn't make sense.
upvoted 1 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