Skip to content

unable to create proper credentials to use Bigquery WIF based setup #706

Description

@saran-sekar

Describe the bug

Credential creation for bigquery doesnt have the options to create connection for bigquery WIF.
https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/resources/bigquery_credential

It misses the auth_type, workload_pool_provider_path, workload_pool_provider_path parameters which are necessary to create the credentials which can be used along with wif based global connection.

Resource configuration

Below is the code which i use via python to call dbt apiv3 to create the desired credential, want a similar one in terraform
url = f"https://emea.dbt.com/api/v3/accounts/{config['dbt_cloud_account_id']}/projects/{config['dbt_project_id']}/credentials/" headers = { "Accept": "application/json", "Authorization": f"Token {var-dbt_cloud_token}", "Content-Type": "application/json" } payload = { "account_id": var - dbt_cloud_account_id, "project_id": var - dbt_project_id, "type": "adapter", "adapter_version": "bigquery_v1", "state": 1, "threads": 16, "credential_details": { "fields": { "auth_type": { "value": "external-oauth-wif", "metadata": { "label": "Authentication Method", "description": "The authentication method to use for this credential.", "field_type": "select", "encrypt": False, "validation": {"required": True}, "options": [ {"label": "Service Account JSON", "value": "service-account-json"}, {"label": "Native OAuth", "value": "oauth-secrets"}, {"label": "Workload Identity Federation", "value": "external-oauth-wif"} ] } }, "workload_pool_provider_path": { "value": var - wif, "metadata": { "label": "Workload Pool Provider Path", "description": "The fully specified resource name of the workload pool provider", "field_type": "text", "encrypt": False, "depends_on": {"auth_type": ["external-oauth-wif"]}, "validation": {"required": True} } }, "workload_pool_provider_path": { "value": f"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/service account name@{var - gcp_project_id}.iam.gserviceaccount.com:generateAccessToken", "metadata": { "label": "Service Account Impersonation URL", "description": "The URL for the service account impersonation request", "field_type": "text", "encrypt": False, "depends_on": {"auth_type": ["external-oauth-wif"]}, "validation": {"required": False} } }, "schema": { "metadata": { "label": "Dataset", "description": "In development, dbt will build your models into a dataset with this name.", "field_type": "text", "encrypt": False, "validation": {"required": True} }, "value": "dbt_cloud" }, "target_name": { "metadata": { "label": "Target name", "description": "", "field_type": "text", "encrypt": False, "validation": {"required": True} }, "value": "default" } } } }

Expected behavior

A clear and concise description of what you expected to happen.

Config (please complete the following information):

( the version can be retrieved running the command terraform providers )

Additional context

Add any other context about the problem here.

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