I could figure out above issue too. Explaining as below:
Find operation on key-vault collection was failing. Hence DEK creation / retrieval operation was also failing. As a result schema also didn’t had id.
Failure was happening because aws lambda role had dbAdmin access. My understanding was wrong about dbAdmin Role. In entire process we do read / write operation as well as schema creation. Schema creation requires dbAdmin role and for other read / write operations readWrite role is required.
And there was no issue in code, After assigning dbAdmin as well as readWrite mongo role to AWS Lambda role things seems to be working fine.
@MaBeuLux88_xxx Your blogpost was very helpful for me to setup entire thing and thanks for your responses. Details about required mongo permissions also can be added to this post. Sharing link here again if anyone looking for it: How to Implement Client-Side Field Level Encryption (CSFLE) in Java with Spring Data MongoDB | MongoDB