简体   繁体   English

使用 Lambda 和 Atlas 进行 MongoDB 字段级加密如何包含 mongocryptd

[英]MongoDB field level encryption with Lambda and Atlas how to include mongocryptd

I try to implement MongoDB client field level encryption with an Atlas M10 cluster and AWS lambda.我尝试使用 Atlas M10 集群和 AWS lambda 实现 MongoDB 客户端字段级加密。 As far as I understand I would need to have the mongocryptd binary in my path which.据我所知,我需要在我的路径中安装 mongocryptd 二进制文件。 How can I bundle this binary with lambda?如何将此二进制文件与 lambda 捆绑在一起?

You can use Lambda Layer in order to package your dependencies.您可以使用Lambda 层来打包您的依赖项。 The Lambda Layer can include pure python library and binary dependencies as well. Lambda 层也可以包含纯 python 库和二进制依赖项。

Here is how I solved it.这是我解决它的方法。 The MongoDB documentation includes a section on how to install the MongoDB enterprise version an Amazon Linux 2 (which in August 2020 is used for lambda containers): https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-amazon-tarball/ MongoDB 文档包含有关如何在 Amazon Linux 2(2020 年 8 月用于 lambda 容器)上安装 MongoDB 企业版的部分: https : //docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-亚马逊 tarball/

I chose to go with tarball installation.我选择使用 tarball 安装。 After downloading and unpacking the archive, I copied the mongocryptd binary into my serverless project and bundled it with the lambda.下载并解压存档后,我将 mongocryptd 二进制文件复制到我的无服务器项目中,并将其与 lambda 捆绑在一起。 Inside the lambda handler I appended the path to binary to the current $PATH, so it is executable.在 lambda 处理程序中,我将二进制路径附加到当前 $PATH,因此它是可执行的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM