github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/google/r/bigquery_table.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Google: google_bigquery_table"
     4  sidebar_current: "docs-google-bigquery-table"
     5  description: |-
     6    Creates a table resource in a dataset for Google BigQuery.
     7  ---
     8  
     9  # google_bigquery_table
    10  
    11  Creates a table resource in a dataset for Google BigQuery. For more information see
    12  [the official documentation](https://cloud.google.com/bigquery/docs/) and
    13  [API](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables).
    14  
    15  
    16  ## Example Usage
    17  
    18  ```hcl
    19  resource "google_bigquery_dataset" "default" {
    20    dataset_id                  = "test"
    21    friendly_name               = "test"
    22    description                 = "This is a test description"
    23    location                    = "EU"
    24    default_table_expiration_ms = 3600000
    25  
    26    labels {
    27      env = "default"
    28    }
    29  }
    30  
    31  resource "google_bigquery_table" "default" {
    32    dataset_id = "${google_bigquery_dataset.default.id}"
    33    table_id   = "test"
    34  
    35    time_partitioning {
    36      type = "DAY"
    37    }
    38  
    39    labels {
    40      env = "default"
    41    }
    42  
    43    schema = "${file("schema.json")}"
    44  }
    45  ```
    46  
    47  ## Argument Reference
    48  
    49  The following arguments are supported:
    50  
    51  * `dataset_id` - (Required) The dataset ID to create the table in.
    52      Changing this forces a new resource to be created.
    53  
    54  * `table_id` - (Required) A unique ID for the resource.
    55      Changing this forces a new resource to be created.
    56  
    57  * `project` - (Optional) The project in which the resource belongs. If it
    58      is not provided, the provider project is used.
    59  
    60  * `description` - (Optional) The field description.
    61  
    62  * `expiration_time` - (Optional) The time when this table expires, in
    63      milliseconds since the epoch. If not present, the table will persist
    64      indefinitely. Expired tables will be deleted and their storage
    65      reclaimed.
    66  
    67  * `friendly_name` - (Optional) A descriptive name for the table.
    68  
    69  * `labels` - (Optional) A mapping of labels to assign to the resource.
    70  
    71  * `schema` - (Optional) A JSON schema for the table.
    72  
    73  * `time_partitioning` - (Optional) If specified, configures time-based
    74      partitioning for this table. Structure is documented below.
    75  
    76  The `time_partitioning` block supports:
    77  
    78  * `expiration_ms` -  (Optional) Number of milliseconds for which to keep the
    79      storage for a partition.
    80  
    81  * `type` - (Required) The only type supported is DAY, which will generate
    82      one partition per day based on data loading time.
    83  
    84  ## Attributes Reference
    85  
    86  In addition to the arguments listed above, the following computed attributes are
    87  exported:
    88  
    89  * `creation_time` - The time when this table was created, in milliseconds since the epoch.
    90  
    91  * `etag` - A hash of the resource.
    92  
    93  * `last_modified_time` - The time when this table was last modified, in milliseconds since the epoch.
    94  
    95  * `location` - The geographic location where the table resides. This value is inherited from the dataset.
    96  
    97  * `num_bytes` - The size of this table in bytes, excluding any data in the streaming buffer.
    98  
    99  * `num_long_term_bytes` - The number of bytes in the table that are considered "long-term storage".
   100  
   101  * `num_rows` - The number of rows of data in this table, excluding any data in the streaming buffer.
   102  
   103  * `self_link` - The URI of the created resource.
   104  
   105  * `type` - Describes the table type.
   106  
   107  ## Import
   108  
   109  Tables can be imported using ID of the table (`projectID`:`datasetID`.`tableID`), e.g.
   110  
   111  ```
   112  $ terraform import bigquery_table.default testproject:testdataset.testtable
   113  ```