google_sourcerepo_repository

A repository (or repo) is a Git repository storing versioned source content.

To get more information about Repository, see:

Open in Cloud Shell

Example Usage - Sourcerepo Repository Basic

resource "google_sourcerepo_repository" "my-repo" {
  name = "my/repository"
}
Open in Cloud Shell

Example Usage - Sourcerepo Repository Full

resource "google_service_account" "test_account" {
  account_id   = "my-account"
  display_name = "Test Service Account"
}

resource "google_pubsub_topic" "topic" {
  name     = "my-topic"
}

resource "google_sourcerepo_repository" "my-repo" {
  name = "my-repository"
  pubsub_configs {
      topic = google_pubsub_topic.topic.id
      message_format = "JSON"
      service_account_email = google_service_account.test_account.email
  }
}

Argument Reference

The following arguments are supported:


The pubsub_configs block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Repository can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Repository using one of the formats above. For example:

import {
  id = "projects/{{project}}/repos/{{name}}"
  to = google_sourcerepo_repository.default
}

When using the terraform import command, Repository can be imported using one of the formats above. For example:

$ terraform import google_sourcerepo_repository.default projects/{{project}}/repos/{{name}}
$ terraform import google_sourcerepo_repository.default {{name}}

User Project Overrides

This resource supports User Project Overrides.