Skip to content

Commit

Permalink
More regions have since been added.
Browse files Browse the repository at this point in the history
$ make testacc TEST=./google TESTARGS='-run=TestAccBigQueryDataset'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google -v -run=TestAccBigQueryDataset -timeout 120m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccBigQueryDataset_basic
=== RUN   TestAccBigQueryDataset_access
=== RUN   TestAccBigQueryDataset_regionalLocation
--- PASS: TestAccBigQueryDataset_basic (7.77s)
--- PASS: TestAccBigQueryDataset_access (13.74s)
--- PASS: TestAccBigQueryDataset_regionalLocation (93.68s)
PASS
ok      github.com/terraform-providers/terraform-provider-google/google 93.731s
  • Loading branch information
gh-mlfowler committed Dec 17, 2018
1 parent 96e94a4 commit bf590f4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion google/resource_bigquery_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func resourceBigQueryDataset() *schema.Resource {
Optional: true,
ForceNew: true,
Default: "US",
ValidateFunc: validation.StringInSlice([]string{"US", "EU", "asia-northeast1", "europe-west2", "australia-southeast1", "asia-southeast1"}, false),
ValidateFunc: validation.StringInSlice([]string{"US", "EU", "asia-east1", "asia-northeast1", "asia-southeast1", "australia-southeast1", "europe-north1", "europe-west2", "us-east4"}, false),
},

// defaultPartitionExpirationMs: [Optional] The default partition
Expand Down
33 changes: 30 additions & 3 deletions google/resource_bigquery_dataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,25 @@ func TestAccBigQueryDataset_regionalLocation(t *testing.T) {
datasetID2 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))
datasetID3 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))
datasetID4 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))
datasetID5 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))
datasetID6 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))
datasetID7 := fmt.Sprintf("tf_test_%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBigQueryDatasetDestroy,
Steps: []resource.TestStep{
{
Config: testAccBigQueryRegionalDataset(datasetID1, "asia-northeast1"),
Config: testAccBigQueryRegionalDataset(datasetID1, "asia-east1"),
},
{
ResourceName: "google_bigquery_dataset.test",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBigQueryRegionalDataset(datasetID2, "australia-southeast1"),
Config: testAccBigQueryRegionalDataset(datasetID2, "asia-northeast1"),
},
{
ResourceName: "google_bigquery_dataset.test",
Expand All @@ -125,7 +128,31 @@ func TestAccBigQueryDataset_regionalLocation(t *testing.T) {
ImportStateVerify: true,
},
{
Config: testAccBigQueryRegionalDataset(datasetID4, "europe-west2"),
Config: testAccBigQueryRegionalDataset(datasetID4, "australia-southeast1"),
},
{
ResourceName: "google_bigquery_dataset.test",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBigQueryRegionalDataset(datasetID5, "europe-north1"),
},
{
ResourceName: "google_bigquery_dataset.test",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBigQueryRegionalDataset(datasetID6, "europe-west2"),
},
{
ResourceName: "google_bigquery_dataset.test",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBigQueryRegionalDataset(datasetID7, "us-east4"),
},
{
ResourceName: "google_bigquery_dataset.test",
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/bigquery_dataset.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The following arguments are supported:
multi-regional location is a large geographic area, such as the United States,
that contains at least two geographic places

Possible regional values include: `asia-northeast1`, `australia-southeast1`,
`asia-southeast1` and `europe-west2`
Possible regional values include: `asia-east1`, `asia-northeast1`, `asia-southeast1`
`australia-southeast1`, `europe-north1`, `europe-west2` and `us-east4`.

Possible multi-regional values:`EU` and `US`.

Expand Down

0 comments on commit bf590f4

Please sign in to comment.