From f745e5f178427c1fbd0e6ad1c388693293ddf939 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Tue, 6 Nov 2018 13:14:36 +0000 Subject: [PATCH] Change BigQuery access list to a set --- google/resource_bigquery_dataset.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google/resource_bigquery_dataset.go b/google/resource_bigquery_dataset.go index a555b9af077..0bda1ad012e 100644 --- a/google/resource_bigquery_dataset.go +++ b/google/resource_bigquery_dataset.go @@ -113,7 +113,7 @@ func resourceBigQueryDataset() *schema.Resource { // or updating a dataset in order to control who is allowed to access // the data. "access": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, // Computed because if unset, BQ adds 4 entries automatically Computed: true, @@ -239,7 +239,8 @@ func resourceDataset(d *schema.ResourceData, meta interface{}) (*bigquery.Datase if v, ok := d.GetOk("access"); ok { access := []*bigquery.DatasetAccess{} - for _, m := range v.([]interface{}) { + vs := v.(*schema.Set) + for _, m := range vs.List() { da := bigquery.DatasetAccess{} accessMap := m.(map[string]interface{}) da.Role = accessMap["role"].(string)