This module allows creating a BigQuery connection.
module "bigquery-connection" {
source = " ./fabric/modules/bigquery-connection"
project_id = var. project_id
location = " EU"
connection_id = " my-connection"
friendly_name = " My Cloud SQL Connection"
description = " A connection to a Cloud SQL instance."
connection_config = {
cloud_sql = {
instance_id = " my-instance-id"
database = " my-database"
type = " POSTGRES"
credential = {
username = " my-username"
password = " my-password"
}
}
}
iam = {
" roles/bigquery.connectionUser" = [" user:my-user@example.com" ]
}
}
# tftest modules=1 resources=2 inventory=cloudsql.yaml
Cloud SQL Connection with Cloud KMS
module "bigquery-connection" {
source = " ./fabric/modules/bigquery-connection"
project_id = var. project_id
location = " EU"
connection_id = " my-connection"
friendly_name = " My BigQuery Connection"
description = " A connection to a Cloud SQL instance."
encryption_key = " my-key"
connection_config = {
cloud_sql = {
instance_id = " my-instance-id"
database = " my-database"
type = " POSTGRES"
credential = {
username = " my-username"
password = " my-password"
}
}
}
}
# tftest modules=1 resources=1 inventory=cloudsql_kms.yaml
module "bigquery-connection" {
source = " ./fabric/modules/bigquery-connection"
project_id = var. project_id
location = " EU"
connection_id = " my-connection"
friendly_name = " My BigQuery Connection"
description = " A connection to a Spanner instance."
connection_config = {
cloud_spanner = {
database = " projects/my-project/instances/my-instance/databases/my-database"
use_parallelism = true
use_data_boost = true
max_parallelism = 2
}
}
iam = {
" roles/bigquery.connectionUser" = [" user:my-user@example.com" ]
}
}
# tftest modules=1 resources=2 inventory=spanner.yaml
Spanner Connection with Context interpolations
module "bigquery-connection" {
source = " ./fabric/modules/bigquery-connection"
project_id = var. project_id
location = " EU"
connection_id = " my-connection"
friendly_name = " My BigQuery Connection"
description = " A connection to a Spanner instance."
connection_config = {
cloud_spanner = {
database = " projects/my-project/instances/my-instance/databases/my-database"
use_parallelism = true
use_data_boost = true
max_parallelism = 2
}
}
context = {
iam_principals = {
myuser = " user:my-user@example.com"
}
}
iam = {
" roles/bigquery.connectionUser" = [" $iam_principals:myuser" ]
}
}
# tftest modules=1 resources=2 inventory=spanner_context.yaml
name
description
type
required
default
connection_id
The ID of the connection.
string
✓
location
The geographic location where the connection should reside.
string
✓
project_id
The ID of the project in which the resource belongs.
string
✓
connection_config
Connection properties.
object({…})
{}
context
Context-specific interpolations.
object({…})
{}
description
A description of the connection.
string
null
encryption_key
The name of the KMS key used for encryption.
string
null
friendly_name
A descriptive name for the connection.
string
null
iam
IAM bindings for the connection in {ROLE => [MEMBERS]} format.
map(list(string))
{}
iam_bindings
Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary.
map(object({…}))
{}
iam_bindings_additive
Individual additive IAM bindings. Keys are arbitrary.
map(object({…}))
{}
iam_by_principals
Authoritative IAM binding in {PRINCIPAL => [ROLES]} format. Principals need to be statically defined to avoid cycle errors. Merged internally with the iam variable.
map(list(string))
{}