Hi everyone,
I am working on a project where we utilize Terraform to manage all BigQuery infrastructure, including datasets, tables, and other resources. I have a scenario where I need to rename a BigQuery table. I understand that this is possible using a DDL command as documented here:
Renaming Table
However, since Terraform does not natively support renaming tables, I am looking for guidance on:
I would appreciate any advice or recommended patterns from those who have faced similar situations.
Thanks!
Hi @skj,
Welcome to Google Cloud Community!
Terraform currently manages BigQuery tables by their unique identifiers, which include the project_id, dataset_id, and table_id. While it doesn’t support directly renaming BigQuery tables, changing the table_id in your google_bigquery_table resource prompts Terraform to recreate the table. This behavior helps ensure resource consistency and clarity, so it’s important to handle such changes carefully to protect your data.
Here's how to approach this, including best practices and considerations:
For the best practices:
Here are some helpful references:
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help