Q48 — AWS SAA-C03 Ch.11

Question 48 of 100 | ← Chapter 11

Q748. A company maintains an Amazon RDS database that maps users to cost centers. The company has accounts in an organization in AWS Organizations. The company needs a solution that will tag all resources that are created in a specific AWS account in the organization. The solution must tag each resource with the cost center ID of the user who created the resource.Which solution will meet these requirements?

Correct Answer: B. Create an AWS Lambda function to tag the resources after the Lambda function looks up the appropriate cost center from the RDS database. Configure an Amazon EventBridge rule that reacts to AWS CloudTrail events to invoke the Lambda function.

Explanation

To meet the requirements of tagging all resources created in a specific AWS account with the cost center ID of the user who created the resource, the solution that would be most suitable is:B. Create an AWS Lambda function to tag the resources after the Lambda function looks up the appropriate cost center from the RDS database. Configure an Amazon EventBridge rule that reacts to AWS CloudTrail events to invoke the Lambda function.Option B, creating an AWS Lambda function to tag resources after looking up the appropriate cost center from the RDS database and configuring an Amazon EventBridge rule to invoke the Lambda function, is the best solution for this scenario. The Lambda function can be written to retrieve the cost center ID from the RDS database based on the user who created the resource. Once the cost center ID is obtained, the Lambda function can tag the resource accordingly. By configuring an Amazon EventBridge rule that reacts to AWS CloudTrail events, the Lambda function can be invoked whenever a resource is created, ensuring that the appropriate cost center tag is applied.Option A, moving the specific AWS account to a new organizational unit (OU) in AWS Organizations and creating a service control policy (SCP) to require the correct cost center tag before resource creation, is not the most appropriate solution for this scenario. While SCPs can help enforce tagging policies, they are not capable of dynamically retrieving information from a database and applying tags based on that information.Option C, creating an AWS CloudFormation stack to deploy an AWS Lambda function, configuring the Lambda function to look up the appropriate cost center from the RDS database, and creating an Amazon EventBridge scheduled rule to invoke the CloudFormation stack, is not the most efficient solution for this scenario. Using a scheduled rule to invoke the CloudFormation stack would introduce unnecessary complexity and delays, as it would only execute at specific time intervals rather than reacting to real-time events.Option D, creating an AWS Lambda function to tag resources with a default value and configuring an Amazon EventBridge rule to invoke the Lambda function when a resource is missing the cost center tag, is not the most suitable solution. This option suggests using a default value for the cost center tag, which may not meet the requirement of tagging resources with the cost center ID of the user who created the resource.Therefore, the solution that meets the requirements of tagging all resources created in a specific AWS account with the cost center ID of the user who created the resource is B: Create an AWS Lambda function to tag the resources after the Lambda function looks up the appropriate cost center from the RDS database. Configure an Amazon EventBridge rule that reacts to AWS CloudTrail events to invoke the Lambda function.