Skip to content

Add support for managing google_bigquery_connection #408

@axtma

Description

@axtma

TL;DR

This feature request proposes enhancing the terraform-google-bigquery module to natively create and manage google_bigquery_connection resources. This would allow users to define datasets and their associated external connections (e.g., to Cloud SQL, AlloyDB, AWS, Azure) within a single, unified module block, streamlining the configuration for federated query setups.

Terraform Resources

This feature would primarily wrap the following Terraform resource:

[google_bigquery_connection](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigquery_connection)

Detailed design

The proposed design introduces a new input variable, connections, to the module. This variable would be a map of objects, where each key represents a unique connection_id and the value is an object containing the configuration for that connection.

This approach allows for the creation of multiple, uniquely configured connections tied to the project and location defined in the module. This could be something like : 


variable "connections" {
  description = "A map of BigQuery connections to create. The key is the connection_id."
  type = map(object({
    friendly_name = optional(string)
    description   = optional(string)
    cloud_sql = optional(object({
      instance_id = string
      database    = string
      type        = string # "POSTGRES" or "MYSQL"
      credential = object({
        username = string
        password = string
      })
    }))
    aws = optional(object({
      access_role = string
    }))
    # Other connection types like 'azure', 'cloud_spanner', etc. would also be included here.
  }))
  default = {}
}

Additional information

Adding this functionality as an optional feature would greatly improve the user experience for a very common use case, which aligns with the core purpose of Terraform modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions