SAP-C02 第 409 题
题目
A company is deploying AWS Lambda functions that access an Amazon RDS for PostgreSQL database. The company needs to launch the Lambda functions in a QA environment and in a production environment. The company must not expose credentials within application code and must rotate passwords automatically. Which solution will meet these requirements?
中文翻译:
一家公司正在部署访问 Amazon RDS for PostgreSQL 数据库的 AWS Lambda 函数。该公司需要在 QA 环境和生产环境中启动 Lambda 函数。公司不得在应用程序代码中公开凭据,并且必须自动轮换密码。哪种解决方案可以满足这些要求?
选项
A. Store the database credentials for both environments in AWS Systems Manager Parameter Store. Encrypt the credentials by using an AWS Key Management Service (AWS KMS) key. Within the application code of the Lambda functions, pull the credentials from the Parameter Store parameter by using the AWS SDK for Python (Boto3). Add a role to the Lambda functions to provide access to the Parameter Store parameter.
中文翻译:
将两个环境的数据库凭证存储在 AWS Systems Manager Parameter Store 中。使用 AWS Key Management Service (AWS KMS) 密钥加密凭证。在 Lambda 函数的应用程序代码中,使用适用于 Python 的 AWS 开发工具包 (Boto3) 从 Parameter Store 参数中提取凭证。向 Lambda 函数添加角色以提供对 Parameter Store 参数的访问。
B. Store the database credentials for both environments in AWS Secrets Manager with distinct key entry for the QA environment and the production environment. Turn on rotation. Provide a reference to the Secrets Manager key as an environment variable for the Lambda functions.
中文翻译:
将两个环境的数据库凭证存储在 AWS Secrets Manager 中,并为 QA 环境和生产环境提供不同的密钥条目。开启旋转。提供对 Secrets Manager 密钥的引用作为 Lambda 函数的环境变量。
C. Store the database credentials for both environments in AWS Key Management Service (AWS KMS). Turn on rotation. Provide a reference to the credentials that are stored in AWS KMS as an environment variable for the Lambda functions.
中文翻译:
将两个环境的数据库凭证存储在 AWS Key Management Service (AWS KMS) 中。开启旋转。提供对作为 Lambda 函数的环境变量存储在 AWS KMS 中的凭证的引用。
D. Create separate S3 buckets for the QA environment and the production environment. Turn on server-side encryption with AWS KMS keys (SSE-KMS) for the S3 buckets. Use an object naming pattern that gives each Lambda function’s application code the ability to pull the correct credentials for the function's corresponding environment. Grant each Lambda function's execution role access to Amazon S3.
中文翻译:
为 QA 环境和生产环境创建单独的 S3 存储桶。使用 AWS KMS 密钥 (SSE-KMS) 为 S3 存储桶启用服务器端加密。使用对象命名模式,使每个 Lambda 函数的应用程序代码能够为该函数的相应环境提取正确的凭证。授予每个 Lambda 函数的执行角色对 Amazon S3 的访问权限。
答案
B
解析
正确答案:B 解析: 本题应选择 B。 正确选项: B. 将两个环境的数据库凭证存储在 AWS Secrets Manager 中,并为 QA 环境和生产环境提供不同的密钥条目。开启旋转。提供对 Secrets Manager 密钥的引用作为 Lambda 函数的环境变量。 选择理由: 该选项最直接地满足题干中的关键约束。做 SAP-C02 题目时,需要同时对照题干里的限定词,例如最高性能、最低运维开销、成本效益、可靠性、可扩展性、安全...