
Answer-first summary for fast verification
Answer: Leverage the AWS::SecretsManager::Secret CloudFormation resource to auto-generate a secure password, store it in AWS Secrets Manager, and dynamically reference this secret for the DB instance password during creation.
The correct answer is D. By using the AWS::SecretsManager::Secret CloudFormation resource, you can generate a secure password automatically and store it directly in AWS Secrets Manager. This approach leverages CloudFormation's native integration with Secrets Manager, minimizing the need for custom code and external tools. It is the most efficient solution in terms of development effort as it utilizes built-in resources and features provided by AWS.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In an AWS environment, a company needs to automate the deployment of Amazon RDS DB instances using CloudFormation templates within a CI/CD pipeline. The requirement is to generate the primary DB instance password automatically during deployment. What is the most development-efficient approach to achieve this?
A
Implement a CloudFormation custom resource backed by an AWS Lambda function to generate a secure password string, then retrieve and apply this string using CloudFormation's Fn::GetAtt function for DB instance creation.
B
Utilize the AWS CodeBuild step in CodePipeline to execute the AWS CLI command 'aws secretsmanager get-random-password' to generate a secure password string, which is then passed as a CloudFormation parameter with NoEcho attribute for use in DB instance creation.
C
Develop a Lambda function for CloudFormation to create a secure password string, store it as a data field in the custom resource response, and use Fn::GetAtt to access it. Subsequently, create and reference this secret in AWS Secrets Manager for DB instance setup.
D
Leverage the AWS::SecretsManager::Secret CloudFormation resource to auto-generate a secure password, store it in AWS Secrets Manager, and dynamically reference this secret for the DB instance password during creation.
No comments yet.