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

google_pubsub_subscription no_wrapper is not supported #17125

Closed gulpinDev closed 9 months ago

gulpinDev commented 9 months ago

Community Note

Terraform Version

Terraform v1.7.1-dev on linux_amd64

Affected Resource(s)

Terraform Configuration Files

resource "google_pubsub_subscription" "subscriptions" {
  for_each   = var.topics_subs_jobs
  name       = each.value.subscription
  topic      = each.value.topic

  dead_letter_policy {
    dead_letter_topic     = var.deadletter_queue_topic
    max_delivery_attempts = var.max_delivery_attempts
  }

  retry_policy {
    minimum_backoff = var.min_backoff
    maximum_backoff = var.max_backoff
  }

  push_config {
    push_endpoint = var.push_endpoint
    oidc_token {
      service_account_email = var.service_account_email
    }
    no_wrapper = {
      write_metadata = true
    }
  }
}

Debug Output

Panic Output

Expected Behavior

The no_wrapper argument should be valid. I've tried with and without an equal (=)

Actual Behavior

│ Error: Unsupported argument │ │ on ../../modules/pubsub/subscriptions/main.tf line 23, in resource "google_pubsub_subscription" "subscriptions": │ 23: no_wrapper = { │ │ An argument named "no_wrapper" is not expected here.

│ Error: Unsupported block type │ │ on ../../modules/pubsub/subscriptions/main.tf line 23, in resource "google_pubsub_subscription" "subscriptions": │ 23: no_wrapper { │ │ Blocks of type "no_wrapper" are not expected here.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

edwardmedia commented 9 months ago

@gulpinDev what do you see if you try below config?

resource "google_pubsub_subscription" "foo" {
  name                 = "mysubscription"
  topic                = google_pubsub_topic.foo.name
  ack_deadline_seconds = 10
  push_config {
    push_endpoint = "https://${data.google_project.project.project_id}.appspot.com"
    oidc_token {
      service_account_email = google_service_account.pub_sub_service_account.email
    }
    no_wrapper {
      write_metadata = true
    }
  }
}
gulpinDev commented 9 months ago

Same error: no_wrapper

edwardmedia commented 9 months ago

@gulpinDev Is v4.0.0 is version you are using? Can you try the latest version instead?

provider registry.terraform.io/hashicorp/google v4.0.0
gulpinDev commented 9 months ago

it was the version! i've updated it to 5.3.0 and now the field is recognised and the change is applied. thank you for helping :)

github-actions[bot] commented 8 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.