Equivalent of gcloud builds submit with terraform?

I’m a bit of a nooby with terraform. I’m trying to replicate some steps from a pub/sub cloud run tutorial in terraform. I’m stuck on the following:

gcloud builds submit "https://github.com/GoogleCloudPlatform/python-docs-samples.git" --tag gcr.io/[PROJECT_ID]/pubsub --git-source-dir="run/pubsub" --git-source-revision="main"

[PROJECT_ID] is my Google Cloud project ID.

I’m trying to build a container within the Google Container Registry from a remote github repo (public, in this case), from a subdirectory containing everything needed. The gcloud command above works fine, but I can’t figure out an equivalent. Any ideas?