How to Create a DocumentDB and use it from Lambda
Everybody loves MongoDB and there are a lot of way to use it: deploy it in an EKS or K8s, an Atlas installation or even deploy on premis. Only the Atlas way gives you the power of easy management, because the service is totally owned by the vendor. There is another solution if you want to use it in AWS: DocumentDB, which is a partially managed service Database totally compatible with MongoDB. It gives you the power to have patching managed by Amazon but requires - believe or not - a little bit of confidence on networking. ASSUMPTIONS To create the cluster AWS needs to be sure that if an instance can be added, there is a chance to work in an high availability zone. It means that you need to create a VPC spanned into multiple AZ and different subnets should work in different AZ. VPC We will use aws cli for all. In our case we will create a VPC with just 2 subnets, each in a different Availability zone. We will save vpc id and subnet id: the first is important for querying, th...