terraform-google-kubernetes-engine icon indicating copy to clipboard operation
terraform-google-kubernetes-engine copied to clipboard

Error: googleapi: Error 400: Must specify a non-empty Pub/Sub topic when Pub/Sub notification is enabled., badRequest

Open red8888 opened this issue 3 years ago • 1 comments

TL;DR

I tried to use the notification config like this:

  notification_config {
    pubsub {
      enabled = true
      topic = data.google_pubsub_topic.notifications.id
    }
  }

Got a super cryptic error I can find zero docs about: Error: googleapi: Error 400: Must specify a non-empty Pub/Sub topic when Pub/Sub notification is enabled., badRequest

Expected behavior

For notifications to be configured without error

Observed behavior

No response

Terraform Configuration

notification_config {
    pubsub {
      enabled = true
      topic = data.google_pubsub_topic.notifications.id
    }
  }


### Terraform Version

```sh
Terraform v0.14.4
+ provider registry.terraform.io/hashicorp/google v3.72.0
+ provider registry.terraform.io/hashicorp/google-beta v3.72.0

Additional information

When I look at the plan I see it appears to be totally ignoring the topic property:

      ~ notification_config {
          ~ pubsub {
              ~ enabled = false -> true
            }
        }

red8888 avatar Aug 01 '22 19:08 red8888

My bad. I had my data source misconfigured.

Although I'm curious why topic is optional. seems like its required right?

red8888 avatar Aug 01 '22 20:08 red8888

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Sep 30 '22 23:09 github-actions[bot]