@@ -40,8 +40,22 @@ var NotebooksInstanceProvidedScopes = []string{
40
40
"https://www.googleapis.com/auth/userinfo.email" ,
41
41
}
42
42
43
+ var NotebooksInstanceProvidedTags = []string {
44
+ "deeplearning-vm" ,
45
+ "notebook-instance" ,
46
+ }
47
+
43
48
func NotebooksInstanceScopesDiffSuppress (_ , _ , _ string , d * schema.ResourceData ) bool {
44
- old , new := d .GetChange ("service_account_scopes" )
49
+ return NotebooksDiffSuppressTemplate ("service_account_scopes" , NotebooksInstanceProvidedScopes , d )
50
+ }
51
+
52
+ func NotebooksInstanceTagsDiffSuppress (_ , _ , _ string , d * schema.ResourceData ) bool {
53
+ return NotebooksDiffSuppressTemplate ("tags" , NotebooksInstanceProvidedTags , d )
54
+ }
55
+
56
+ func NotebooksDiffSuppressTemplate (field string , defaults []string , d * schema.ResourceData ) bool {
57
+ old , new := d .GetChange (field )
58
+
45
59
oldValue := old .([]interface {})
46
60
newValue := new .([]interface {})
47
61
oldValueList := []string {}
@@ -54,7 +68,7 @@ func NotebooksInstanceScopesDiffSuppress(_, _, _ string, d *schema.ResourceData)
54
68
for _ , item := range newValue {
55
69
newValueList = append (newValueList , item .(string ))
56
70
}
57
- newValueList = append (newValueList , NotebooksInstanceProvidedScopes ... )
71
+ newValueList = append (newValueList , defaults ... )
58
72
59
73
sort .Strings (oldValueList )
60
74
sort .Strings (newValueList )
@@ -469,11 +483,12 @@ Enabled by default.`,
469
483
Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` ,
470
484
},
471
485
"tags" : {
472
- Type : schema .TypeList ,
473
- Computed : true ,
474
- Optional : true ,
475
- ForceNew : true ,
476
- Description : `The Compute Engine tags to add to instance.` ,
486
+ Type : schema .TypeList ,
487
+ Computed : true ,
488
+ Optional : true ,
489
+ ForceNew : true ,
490
+ DiffSuppressFunc : NotebooksInstanceTagsDiffSuppress ,
491
+ Description : `The Compute Engine tags to add to instance.` ,
477
492
Elem : & schema.Schema {
478
493
Type : schema .TypeString ,
479
494
},
0 commit comments