cloud-foundation-fabric/modules/source-repository
Dan Farmer 52eb83758f Fix compute-vm:CloudKMS test for provider>=4.54.0
* TF provider >= 4.54.0 now returns `rsa_encrypted_key` for
  `google_compute_disk.disks["attached-disk"]` (see
  hashicorp/terraform-provider-google#4448)
* Add this field to expected model to fix test assertion failure
* Update required TF provider to 4.55.0 (latest) since the assertion
  will now fail with <4.54.0, which do not return `rsa_encrypted_key`
  * Updated the whole repo on advice from @ludoo
2023-02-28 15:10:22 +00:00
..
README.md Enforce terraform fmt in examples 2022-12-18 14:00:19 +01:00
iam.tf CI/CD support for Source Repository and Cloud Build (#669) 2022-06-08 11:34:08 +02:00
main.tf CI/CD support for Source Repository and Cloud Build (#669) 2022-06-08 11:34:08 +02:00
outputs.tf CI/CD support for Source Repository and Cloud Build (#669) 2022-06-08 11:34:08 +02:00
variables.tf CI/CD support for Source Repository and Cloud Build (#669) 2022-06-08 11:34:08 +02:00
versions.tf Fix compute-vm:CloudKMS test for provider>=4.54.0 2023-02-28 15:10:22 +00:00

README.md

Google Cloud Source Repository Module

This module allows managing a single Cloud Source Repository, including IAM bindings and basic Cloud Build triggers.

Examples

Repository with IAM

module "repo" {
  source     = "./fabric/modules/source-repository"
  project_id = "my-project"
  name       = "my-repo"
  iam = {
    "roles/source.reader" = ["user:foo@example.com"]
  }
}
# tftest modules=1 resources=2

Repository with Cloud Build trigger

module "repo" {
  source     = "./fabric/modules/source-repository"
  project_id = "my-project"
  name       = "my-repo"
  triggers = {
    foo = {
      filename        = "ci/workflow-foo.yaml"
      included_files  = ["**/*tf"]
      service_account = null
      substitutions = {
        BAR = 1
      }
      template = {
        branch_name = "main"
        project_id  = null
        tag_name    = null
      }
    }
  }
}
# tftest modules=1 resources=2

Files

name description resources
iam.tf IAM resources. google_sourcerepo_repository_iam_binding · google_sourcerepo_repository_iam_member
main.tf Module-level locals and resources. google_cloudbuild_trigger · google_sourcerepo_repository
outputs.tf Module outputs.
variables.tf Module variables.
versions.tf Version pins.

Variables

name description type required default
name Repository name. string
project_id Project used for resources. string
group_iam Authoritative IAM binding for organization groups, in {GROUP_EMAIL => [ROLES]} format. Group emails need to be static. Can be used in combination with the iam variable. map(list(string)) {}
iam IAM bindings in {ROLE => [MEMBERS]} format. map(list(string)) {}
iam_additive IAM additive bindings in {ROLE => [MEMBERS]} format. map(list(string)) {}
iam_additive_members IAM additive bindings in {MEMBERS => [ROLE]} format. This might break if members are dynamic values. map(list(string)) {}
triggers Cloud Build triggers. map(object({…})) {}

Outputs

name description sensitive
id Repository id.
name Repository name.
url Repository URL.