exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

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

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 2 discussion

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
Untamables
Highly Voted 2 years, 1 month ago
Selected Answer: D
The correct answer is D. Amazon EC2 instances can send the state-change notification events to Amazon EventBridge. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instance-state-changes.html Amazon EventBridge can send and receive events between event buses in AWS accounts. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html
upvoted 20 times
jipark
1 year, 8 months ago
thanks a lot
upvoted 1 times
...
...
geekdamsel
Highly Voted 1 year, 11 months ago
This question came in exam. Correct answer is D.
upvoted 11 times
...
7948dca
Most Recent 2 months, 3 weeks ago
Selected Answer: C
Either C or D. Down side of C: Needs to trigger everyone min but very flexible. D: is completely automated but giving access to other aws account is not safe.
upvoted 1 times
...
sumanshu
4 months, 1 week ago
Selected Answer: D
https://docs.aws.amazon.com/us_en/eventbridge/latest/userguide/eb-cross-account.html#:~:text=You%20can%20configure%20EventBridge%20to%20send%20and%20receive,events%20from%20the%20event%20bus%20in%20your%20account.
upvoted 1 times
sumanshu
4 months, 1 week ago
A) Eliminated - Amazon EC2 itself does not send lifecycle events directly to EventBridge in another account. The EC2 lifecycle events would be published to EventBridge within the account where the EC2 instance resides. The key here is using EventBridge cross-account event bus access. Amazon EventBridge allows for event buses to receive events from other AWS accounts if the appropriate permissions are set.
upvoted 1 times
sumanshu
4 months, 1 week ago
B) Will work as Option B is implying a direct route from each AWS account’s EventBridge to the main account’s SQS queue, bypassing the main account's EventBridge event bus - Eliminated - as No centralized events, which is in Option D
upvoted 1 times
sumanshu
4 months, 1 week ago
C) Eliminated - more maintenance overhead of LAMBDA
upvoted 1 times
...
...
...
...
trieudo
4 months, 2 weeks ago
Selected Answer: D
==> Discard C: lamdba scans ==> it will be delay by scan all data ==> Discard A: 'matches all EC2 instance' ==> hard to maintain, when updating many times can occurs ==> Discard B: it works, but it maybe have some security problem when pushing raw data (not clean) into SQS. It also doesn't take advantage of D: By configuring the main account's event bus to accept events from other accounts and adding rules in those accounts to forward lifecycle events, this solution achieves secure and efficient centralization. EventBridge then routes the events to an SQS queue in the main account for further processing.
upvoted 2 times
...
Anandesh
9 months, 2 weeks ago
Selected Answer: D
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html
upvoted 1 times
...
NagaoShingo
10 months, 4 weeks ago
Selected Answer: D
D is correct answer.
upvoted 1 times
...
65703c1
11 months, 1 week ago
D is the correct answer.
upvoted 1 times
...
xdkonorek2
1 year, 4 months ago
Selected Answer: D
Tried to implement both B and D It's tricky, because B could be possible but you can't select cross-account SQS as target to the rule, option D is 100% correct
upvoted 1 times
...
dongocanh272
1 year, 5 months ago
Selected Answer: D
My answer is D
upvoted 2 times
...
Digo30sp
1 year, 6 months ago
Selected Answer: D
Answer C is correct
upvoted 1 times
...
TeeTheMan
1 year, 9 months ago
Selected Answer: B
Seems to me the correct answer is B. The current most voted answer is B, but can someone explain why it’s better than B? I think B is better because it has fewer steps. The events go straight from each account into the queue. Unlike in D which has the intermediate step of the event bus of the main account. Also, why would you want to pollute the event bus of the main account with events from other accounts when it isn’t necessary?
upvoted 5 times
...
KillThemWithKindness
1 year, 9 months ago
B Answer A is incorrect because Amazon EventBridge events can't be sent directly from one account's event bus to another. Answer C is incorrect because it's unnecessary and inefficient to use Lambda to periodically scan all EC2 instances for lifecycle changes. Amazon EventBridge can capture these events automatically as they occur. Answer D is incorrect because it is not possible to configure the main account event bus to receive events from all accounts directly, and Amazon EventBridge events can't be sent directly from one account's event bus to another. The EventBridge rules need to be set up in the accounts where the events are generated.
upvoted 2 times
KillThemWithKindness
1 year, 9 months ago
Sorry Im wrong, AWS allow to send and receive Amazon EventBridge events between AWS accounts. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html Both B and D works, but D is more centralized
upvoted 4 times
...
...
ezredame
1 year, 11 months ago
Selected Answer: D
The correct answer is D. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html
upvoted 2 times
...
Bibay
1 year, 11 months ago
Selected Answer: A
Option D is not the best solution because it involves configuring the permissions on the main account's EventBridge event bus to receive events from all accounts, which can lead to potential security risks. Allowing other AWS accounts to send events to the main account's EventBridge event bus can potentially open up a security vulnerability, as it increases the attack surface area for the main account. On the other hand, option A is the best solution because it involves using Amazon EventBridge, which is a serverless event bus that can be used to route events between AWS services or AWS accounts. By configuring Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account, and adding the SQS queue as a target of the rule, the application can collect all the lifecycle events of the EC2 instances in a single queue in the main account without compromising the security posture of the AWS environment.
upvoted 1 times
...
ihebchorfi
1 year, 12 months ago
Selected Answer: B
B solution meets all da requirements. By using resource policies, you can grant permissions for other accounts to write to the SQS queue in the main account. Then, you create EventBridge rules in each account dat match EC2 lifecycle events and use da main account's SQS queue as a target for these rules. It's da best choice for dis scenario.
upvoted 1 times
...
MrTee
2 years ago
Selected Answer: D
This solution allows the collection of all the lifecycle events of the EC2 instances from multiple AWS accounts and stores them in a single Amazon SQS queue in the company’s main AWS account for further processing
upvoted 2 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