Can GCDS (Google Cloud Directory Sync) trigger a cloud function?

I would like to run a Google Cloud function that renames the posixAccounts -> {username,homeDirectory} in Google Directory . I am hoping that it's possible to have the function triggered after a successful run of GCDS. Is this possible? Is there a better way to have these attributes changed after a GCDS?


If you are using a 3rd party LDAP server and to answer your question, it is not possible. Since GCDS will only sync from LDAP server to your Google Directory.

But if you are using Google Workspaces Admin, one option is Google's directory API, you can check this overview also.

This is just a theory as I haven't tested it yet, but you can try to forward Admin audit logs to Cloud Logging, and then create a log sink to forward the logs to a Pub/Sub topic, and then trigger the function.