@@ -109,6 +109,13 @@ Please refer to the field 'effective_annotations' for all of the annotations pre
109
109
Please refer to the field 'effective_labels' for all of the labels present on the resource.` ,
110
110
Elem : & schema.Schema {Type : schema .TypeString },
111
111
},
112
+ "source_workstation" : {
113
+ Type : schema .TypeString ,
114
+ Optional : true ,
115
+ ForceNew : true ,
116
+ Description : `Full resource name of the source workstation from which the workstation's persistent
117
+ directories will be cloned from during creation.` ,
118
+ },
112
119
"create_time" : {
113
120
Type : schema .TypeString ,
114
121
Computed : true ,
@@ -186,6 +193,12 @@ func resourceWorkstationsWorkstationCreate(d *schema.ResourceData, meta interfac
186
193
} else if v , ok := d .GetOkExists ("env" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (envProp )) && (ok || ! reflect .DeepEqual (v , envProp )) {
187
194
obj ["env" ] = envProp
188
195
}
196
+ source_workstationProp , err := expandWorkstationsWorkstationSourceWorkstation (d .Get ("source_workstation" ), d , config )
197
+ if err != nil {
198
+ return err
199
+ } else if v , ok := d .GetOkExists ("source_workstation" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (source_workstationProp )) && (ok || ! reflect .DeepEqual (v , source_workstationProp )) {
200
+ obj ["source_workstation" ] = source_workstationProp
201
+ }
189
202
labelsProp , err := expandWorkstationsWorkstationEffectiveLabels (d .Get ("effective_labels" ), d , config )
190
203
if err != nil {
191
204
return err
@@ -324,6 +337,9 @@ func resourceWorkstationsWorkstationRead(d *schema.ResourceData, meta interface{
324
337
if err := d .Set ("state" , flattenWorkstationsWorkstationState (res ["state" ], d , config )); err != nil {
325
338
return fmt .Errorf ("Error reading Workstation: %s" , err )
326
339
}
340
+ if err := d .Set ("source_workstation" , flattenWorkstationsWorkstationSourceWorkstation (res ["source_workstation" ], d , config )); err != nil {
341
+ return fmt .Errorf ("Error reading Workstation: %s" , err )
342
+ }
327
343
if err := d .Set ("terraform_labels" , flattenWorkstationsWorkstationTerraformLabels (res ["labels" ], d , config )); err != nil {
328
344
return fmt .Errorf ("Error reading Workstation: %s" , err )
329
345
}
@@ -579,6 +595,10 @@ func flattenWorkstationsWorkstationState(v interface{}, d *schema.ResourceData,
579
595
return v
580
596
}
581
597
598
+ func flattenWorkstationsWorkstationSourceWorkstation (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
599
+ return v
600
+ }
601
+
582
602
func flattenWorkstationsWorkstationTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
583
603
if v == nil {
584
604
return v
@@ -617,6 +637,10 @@ func expandWorkstationsWorkstationEnv(v interface{}, d tpgresource.TerraformReso
617
637
return m , nil
618
638
}
619
639
640
+ func expandWorkstationsWorkstationSourceWorkstation (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
641
+ return v , nil
642
+ }
643
+
620
644
func expandWorkstationsWorkstationEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
621
645
if v == nil {
622
646
return map [string ]string {}, nil
0 commit comments