@@ -318,6 +318,21 @@ NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE.
318
318
The default is NFSv3. Default value: "NFS_V3" Possible values: ["NFS_V3", "NFS_V4_1"]` ,
319
319
Default : "NFS_V3" ,
320
320
},
321
+ "tags" : {
322
+ Type : schema .TypeMap ,
323
+ Optional : true ,
324
+ ForceNew : true ,
325
+ Description : `A map of resource manager tags. Resource manager tag keys
326
+ and values have the same definition as resource manager
327
+ tags. Keys must be in the format tagKeys/{tag_key_id},
328
+ and values are in the format tagValues/456. The field is
329
+ ignored when empty. The field is immutable and causes
330
+ resource replacement when mutated. This field is only set
331
+ at create time and modifying this field after creation
332
+ will trigger recreation. To apply tags to an existing
333
+ resource, see the 'google_tags_tag_value' resource.` ,
334
+ Elem : & schema.Schema {Type : schema .TypeString },
335
+ },
321
336
"zone" : {
322
337
Type : schema .TypeString ,
323
338
Computed : true ,
@@ -424,6 +439,12 @@ func resourceFilestoreInstanceCreate(d *schema.ResourceData, meta interface{}) e
424
439
} else if v , ok := d .GetOkExists ("performance_config" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (performanceConfigProp )) && (ok || ! reflect .DeepEqual (v , performanceConfigProp )) {
425
440
obj ["performanceConfig" ] = performanceConfigProp
426
441
}
442
+ tagsProp , err := expandFilestoreInstanceTags (d .Get ("tags" ), d , config )
443
+ if err != nil {
444
+ return err
445
+ } else if v , ok := d .GetOkExists ("tags" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (tagsProp )) && (ok || ! reflect .DeepEqual (v , tagsProp )) {
446
+ obj ["tags" ] = tagsProp
447
+ }
427
448
labelsProp , err := expandFilestoreInstanceEffectiveLabels (d .Get ("effective_labels" ), d , config )
428
449
if err != nil {
429
450
return err
@@ -1406,6 +1427,17 @@ func expandFilestoreInstancePerformanceConfigFixedIopsMaxIops(v interface{}, d t
1406
1427
return v , nil
1407
1428
}
1408
1429
1430
+ func expandFilestoreInstanceTags (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
1431
+ if v == nil {
1432
+ return map [string ]string {}, nil
1433
+ }
1434
+ m := make (map [string ]string )
1435
+ for k , val := range v .(map [string ]interface {}) {
1436
+ m [k ] = val .(string )
1437
+ }
1438
+ return m , nil
1439
+ }
1440
+
1409
1441
func expandFilestoreInstanceEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
1410
1442
if v == nil {
1411
1443
return map [string ]string {}, nil
0 commit comments