Reputation: 1005
I am trying to create a Google Cloud function through Terraform. The source code for the function is in Enterprise GitHub. https://github.xyz.com/cf
The Terraform code is as below:
resource "google_cloudfunctions_function" "cfcluster" {
name = "cfcluster1"
project = "${var.project_id}"
region = "us-central1"
runtime = "python39"
source_repository {
//url="https://github.xyz.com/cf" #is this possible?
}
Is it possible to connect to Enterprise GitHub from Google CloudFunction in Terraform? How can I achieve it?
I don't want to connect to cloud-source repository from Terraform.
Upvotes: 1
Views: 264
Reputation: 1701
I don't think you can pull data from a GitHub repository directly. What you can do is to mirror it to your project's Cloud Repository, and then you can use the data within the Google Cloud Platform as you wish. Here you can find a document on how to mirror your GitHub Repository [1].
You can also take a look at this tutorial [2], here you can find the complete steps to deploy an application in Google Cloud Platform from a Github Repository.
[1] https://cloud.google.com/source-repositories/docs/mirroring-a-github-repository
[2] https://medium.com/swlh/deploying-github-repository-to-google-cloud-platform-997d296547e6
Upvotes: 1