Skip to content

Commit

Permalink
Change BigQuery access list to a set
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst authored and nat-henderson committed Dec 21, 2018
1 parent a738196 commit f745e5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions google/resource_bigquery_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f745e5f

Please sign in to comment.