def customize_template_subs()

in scripts/generate_terraform.py [0:0]


def customize_template_subs(resource: dict, subs: dict) -> dict:
    if resource["type"] == "storage_bucket":
        subs["name"] = validate_bucket_name(resource["name"])
        subs["uniform_bucket_level_access"] = resource.get(
            "uniform_bucket_level_access"
        )
    elif resource["type"] == "bigquery_table":
        dataset_table = f"{subs['dataset_id']}_{resource['table_id']}"

        # Terraform resource names cannot start with digits, but BigQuery allows
        # table names that start with digits. We prepend `bqt_` to table names
        # that doesn't comply with Terraform's naming rule.
        if resource["table_id"][0].isdigit():
            subs["tf_resource_name"] = f"bqt_{dataset_table}"
        else:
            subs["tf_resource_name"] = dataset_table
    return subs