GoogleCloudPlatform / terraform-google-cloud-functions

Deploys Cloud Functions (Gen 2)
https://registry.terraform.io/modules/GoogleCloudPlatform/cloud-functions/google
Apache License 2.0
32 stars 27 forks source link

Storage source using wrong variable name #121

Closed electropolis closed 4 months ago

electropolis commented 4 months ago

In the module main.tf there section beginning from line 32

 source {
      dynamic "storage_source" {
        for_each = var.repo_source == null ? [var.storage_source] : []
        content {
          bucket     = storage_source.value.bucket
          object     = storage_source.value.object
          generation = storage_source.value.generation
        }
      }

      dynamic "repo_source" {
        for_each = var.storage_source == null ? [var.repo_source] : []
        content {
          project_id   = repo_source.value.project_id
          repo_name    = repo_source.value.repo_name
          branch_name  = repo_source.value.branch_name
          dir          = repo_source.value.dir
          tag_name     = repo_source.value.tag_name
          commit_sha   = repo_source.value.commit_sha
          invert_regex = repo_source.value.invert_regex
        }
      }
    }

I belive here for_each = var.repo_source that comes from dynamic "storage_source" block should be var.storage_source and for_each = var.storage_source that comes from dynamic "repo_source" should be for_each = var.repo_source

Or not?

electropolis commented 4 months ago

Didn't saw that its a conditional 😵‍💫

electropolis commented 4 months ago

Closing again