Question 1 of 30
A company is deploying a multi-tier web application using AWS CloudFormation. The architecture consists of a front-end layer hosted on Amazon S3, a back-end layer using AWS Lambda, and a database layer utilizing Amazon RDS. The CloudFormation template needs to ensure that the Lambda function can access the RDS instance securely. Which of the following configurations in the CloudFormation template would best facilitate this secure access while adhering to AWS best practices?
Define an IAM role for the Lambda function with permissions to access the RDS instance and attach this role to the Lambda function in the CloudFormation template.
Hardcode the RDS database credentials directly into the Lambda function code to ensure it can connect to the database.
Use AWS Secrets Manager to store the RDS credentials and reference the secret in the Lambda function environment variables without any IAM role.
Create a security group that allows all inbound traffic to the RDS instance and assign it to the Lambda function.

Preparing for Amazon CLF-C02 AWS Certified Cloud Practitioner (CLF-C02)? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free