Is there a way to auto-join GCP compute Engine(Windows/Linux) to Active Directory Domain Services. Found that terraform doesnot support this.
Actually, GCE VM instances do not join the domain, but OSes running on top of the instances do. Hence the question is rather about domain joining automation in Windows and Linux, not about Google Compute Engine.
As for GCE, it can make sysadmin's life easier with the Startup scripts feature. Just put your automation scripts in there. It could bring some security challenges though: you should be careful providing security credentials in startup scripts.
Another approach is to create customized images in GCE, that contain startup scripts and security credentials inside of them, and then use that images with the VM instance templates.
It is up-to-you how to automate domain joining from within the freshly booted OS. There is a lot of solutions available in the Internet. For example:
Unattended setup with
Unattend.txt for Windows has been known for ages. Nowadays
Unattended.xml is in use for Win 10.
How to Automate a domain join on linux has been already discussed on StackExchange as well.