I am having difficult time connecting GitHub Repository with GCP Cloud build using Terraform.
In one of the projects I have connected it manually trough the console, without Terraform but that is not helping me, trying to automate the process. Below I am attaching the code that I am trying to use.
In order to use the GitHub repo, I first had to manually connect the repository through Cloud Build | Triggers | CONNECT REPOSITORY. Once the repository is linked, my Terraform issue described here went away. Connecting process opens a window to GitHub repo search to link individual repos. I'm not sure yet how to get around this.
resource "google_cloudbuild_trigger" "my_cloudbuild_trigger" {
name = "my-trigger"
description = "Trigger on push to ${var.branch_name} branch"
filename = "cloudbuild.yaml"
project = var.project_id
github {
owner = # replace with your organization name
name = # replace with your repository name
push {
branch = var.branch_name
}
}
}
Error creating Trigger: googleapi: Error 400: Repository mapping does not exist. Please visit
Tried everything I found on the internet so far, expecting to connect to the Repo but nothing worked so far.