Skip to content

bigquery_subscription does not have max_delivery_attempts attribute #240

@karolpivo

Description

@karolpivo

TL;DR

Unsupported attribute "max_delivery_attempts" in google_pubsub_subscription resource
When using the Google Cloud Pub/Sub Terraform module, I'm encountering an error related to the max_delivery_attempts attribute in the google_pubsub_subscription resource.

Error: Unsupported attribute

  on .terraform/modules/tasks-scheduler.scheduler_pubsub/main.tf line 294, in resource "google_pubsub_subscription" "bigquery_subscriptions":
  294:       max_delivery_attempts = each.value.max_delivery_attempts != null ? each.value.max_delivery_attempts : "5"
     ├────────────────
     │ each.value is object with 15 attributes

This object does not have an attribute named "max_delivery_attempts".

The problem is that this attribute does not exist in the var

variable "bigquery_subscriptions" {
  type = list(object({
    name                       = string,
    table                      = string,
    use_topic_schema           = optional(bool),
    use_table_schema           = optional(bool),
    write_metadata             = optional(bool),
    drop_unknown_fields        = optional(bool),
    ack_deadline_seconds       = optional(number),
    retain_acked_messages      = optional(bool),
    message_retention_duration = optional(string),
    enable_message_ordering    = optional(bool),
    expiration_policy          = optional(string),
    filter                     = optional(string),
    dead_letter_topic          = optional(string),
    maximum_backoff            = optional(string),
    minimum_backoff            = optional(string)
  }))
  description = "The list of the Bigquery push subscriptions."
  default     = []
}

Expected behavior

The module should properly handle retry policy configuration for BigQuery Pub/Sub subscriptions.

Observed behavior

│ Error: Unsupported attribute
│ 
│   on .terraform/modules/tasks-scheduler.scheduler_pubsub/main.tf line 294, in resource "google_pubsub_subscription" "bigquery_subscriptions":
│  294:       max_delivery_attempts = each.value.max_delivery_attempts != null ? each.value.max_delivery_attempts : "5"
│     ├────────────────
│     │ each.value is object with 15 attributes
│ 
│ This object does not have an attribute named "max_delivery_attempts".

Terraform Configuration

n/a

Terraform Version

1.9.8

Terraform Provider Versions

terraform {
  required_version = "1.9.8"
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "6.25.0"
    }
  }
}

Additional information

module 8.0.1

terraform {
required_version = "1.9.8"
required_providers {
google = {
source = "hashicorp/google"
version = "6.25.0"
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions