Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Renaming table in BigQuery using terraform

skj
Bronze 1
Bronze 1

 

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:

  • How to handle this within Terraform
  • What are the best practices for managing such changes without breaking the Terraform state
  • Whether it's better to clone/create a new table and deprecate the old one
  • How to manage the terraform state or import correctly in such cases

I would appreciate any advice or recommended patterns from those who have faced similar situations.

Thanks!

0 2 70
2 REPLIES 2