Skip to content

Commit

Permalink
send friendly_name (GoogleCloudPlatform#7433)
Browse files Browse the repository at this point in the history
* send friendly_name

* fixed validator failures

* update

* fix validator errors

---------

Co-authored-by: Edward Sun <sunedward@google.com>
  • Loading branch information
2 people authored and ericayyliu committed Jul 26, 2023
1 parent 0fbbc85 commit ea0e35d
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
2 changes: 2 additions & 0 deletions mmv1/products/bigquery/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
default_from_api: true
maxTimeTravelHours: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
friendlyName: !ruby/object:Overrides::Terraform::PropertyOverride
send_empty_value: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
constants: templates/terraform/constants/bigquery_dataset.go.erb
docs: !ruby/object:Provider::Terraform::Docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ func TestAccBigQueryDataset_basic(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBigQueryDatasetUpdated2(datasetID),
},
{
ResourceName: "google_bigquery_dataset.test",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -212,6 +220,24 @@ resource "google_bigquery_dataset" "test" {
`, datasetID)
}

func testAccBigQueryDatasetUpdated2(datasetID string) string {
return fmt.Sprintf(`
resource "google_bigquery_dataset" "test" {
dataset_id = "%s"
# friendly_name = "bar"
description = "This is a bar description"
location = "EU"
default_partition_expiration_ms = 7200000
default_table_expiration_ms = 7200000
labels = {
env = "bar"
default_table_expiration_ms = 7200000
}
}
`, datasetID)
}

func testAccBigQueryDatasetDeleteContents(datasetID string) string {
return fmt.Sprintf(`
resource "google_bigquery_dataset" "contents_test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"discovery_name": "Dataset",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data": {
"friendlyName": "",
"datasetReference": {
"datasetId": "test-dataset"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"labels": {
"env": "dev"
},
"location": "EU"
"location": "EU",
"friendlyName": ""
}
},
"iam_policy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"labels": {
"env": "dev"
},
"location": "EU"
"location": "EU",
"friendlyName": ""
}
},
"iam_policy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"labels": {
"env": "dev"
},
"location": "EU"
"location": "EU",
"friendlyName": ""
}
},
"iam_policy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"datasetReference": {
"datasetId": "example_dataset"
},
"location": "US"
"location": "US",
"friendlyName": ""
}
},
"iam_policy": {
Expand Down

0 comments on commit ea0e35d

Please sign in to comment.