SAP-C02 第 498 题
题目
Accompany runs an application on Amazon EC2 and AWS Lambda. The application stores temporary data in Amazon S3. The S3 objects are deleted after 24 hours. The company deploys new versions of the application by launching AWS CloudFormation stacks. The stacks create the required resources. After validating a new version, the company deletes the old stack. The deletion of an old development stack recently failed. A solutions architect needs to resolve this issue without major architecture changes. Which solution will meet these requirements?
中文翻译:
Accompany 在 Amazon EC2 和 AWS Lambda 上运行应用程序。该应用程序将临时数据存储在 Amazon S3 中。 S3 对象将在 24 小时后删除。该公司通过启动 AWS CloudFormation 堆栈来部署该应用程序的新版本。堆栈创建所需的资源。验证新版本后,公司将删除旧堆栈。最近删除旧开发堆栈失败。解决方案架构师需要在不进行重大架构更改的情况下解决此问题。哪种解决方案可以满足这些要求?
选项
A. Create a Lambda function to delete objects from an S3 bucket. Add the Lambda function as a custom resource in the CloudFormation stack with a DependsOn attribute that points to the S3 bucket resource.
中文翻译:
创建 Lambda 函数以从 S3 存储桶中删除对象。将 Lambda 函数作为自定义资源添加到 CloudFormation 堆栈中,并使用指向 S3 存储桶资源的 DependsOn 属性。
B. Modify the CloudFormation stack to attach a DeletionPolicy attribute with a value of Delete to the S3 bucket.
中文翻译:
修改 CloudFormation 堆栈以将值为“Delete”的 DeletionPolicy 属性附加到 S3 存储桶。
C. Update the CloudFormation stack to add a DeletionPolicy attribute with a value of Snapshot for the S3 bucket resource
中文翻译:
更新 CloudFormation 堆栈,为 S3 存储桶资源添加值为 Snapshot 的 DeletionPolicy 属性
D. Update the CloudFormation template to create an Amazon Elastic File System (Amazon EFS) file system to store temporary files instead of Amazon S3. Configure the Lambda functions to run in the same VPC as the EFS file system.
中文翻译:
更新 CloudFormation 模板以创建 Amazon Elastic File System (Amazon EFS) 文件系统来存储临时文件而不是 Amazon S3。将 Lambda 函数配置为在与 EFS 文件系统相同的 VPC 中运行。
答案
A
解析
正确答案:A 解析: 本题应选择 A。 正确选项: A. 创建 Lambda 函数以从 S3 存储桶中删除对象。将 Lambda 函数作为自定义资源添加到 CloudFormation 堆栈中,并使用指向 S3 存储桶资源的 DependsOn 属性。 选择理由: 该选项最直接地满足题干中的关键约束。做 SAP-C02 题目时,需要同时对照题干里的限定词,例如最高性能、最低运维开销、成本效益、可靠性、可扩展性、安全性、RTO/RPO、合...