hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.74k forks source link

Only github and trigger_template should be mutually exclusive with google_cloudbuild_trigger #10277

Closed brtkwr closed 7 months ago

brtkwr commented 3 years ago

Community Note

Terraform Version

1.0.8

Affected Resource(s)

Terraform Configuration Files

resource "google_cloudbuild_trigger" "portals-pubsub-test-1" {

  name = "portals-pubsub-test-1"
  description = "Deploy portals production image to test env"

  github {
    name = "demo-portals"
    owner = "demo"
    push {
      branch = "staging"
      invert_regex = false
    }
  }

  pubsub_config {
    topic = "projects/demo-api/topics/cloud-builds"
  }

  substitutions = {
    _ENVIRONMENT = "test"
  }

  filename = "cloudbuild-pubsub.yaml"
}

Debug Output

Panic Output

Expected Behavior

SUCCESS

Based on the docs, only triggerTemplate and Github are mutually exclusive, others should be allows.

Actual Behavior

"webhook_config": only one of `github,pubsub_config,trigger_template,webhook_config` can be specified, but `github,pubsub_config` were specified.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

abhinavrau commented 2 years ago

This has been fixed with PR GoogleCloudPlatform/magic-modules#5738. Take a look at the example here on how to create a pub/sub build with git repo.

rileykarson commented 7 months ago

Closing based on https://github.com/GoogleCloudPlatform/magic-modules/pull/5738

github-actions[bot] commented 6 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.