How to clone private github repository with terraform?

Hello There! I’m trying to launch an EC2 ubuntu instance, run a linux housekeeping script and pull a few private repositories from Github, and then run apps in docker containers.
And it looks like I am stuck with cloning private github repos, is it possible to run git clone <private repo> in the remote-exec block, or is it better to search for other ways?