@@ -161,8 +161,7 @@ func resourceInstance() *schema.Resource {
161
161
},
162
162
},
163
163
"interface" : & schema.Schema {
164
- Type : schema .TypeSet ,
165
- Set : interfaceUniqueID ,
164
+ Type : schema .TypeList ,
166
165
Required : true ,
167
166
Elem : & schema.Resource {
168
167
Schema : map [string ]* schema.Schema {
@@ -180,6 +179,7 @@ func resourceInstance() *schema.Resource {
180
179
Type : schema .TypeString ,
181
180
Description : "required if type is 'subnet' or 'any_subnet'" ,
182
181
Optional : true ,
182
+ Computed : true ,
183
183
},
184
184
"subnet_id" : {
185
185
Type : schema .TypeString ,
@@ -396,7 +396,7 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, m inter
396
396
createOpts .Volumes = vs
397
397
}
398
398
399
- ifs := d .Get ("interface" ).(* schema. Set ). List ( )
399
+ ifs := d .Get ("interface" ).([] interface {} )
400
400
//sort interfaces by 'order' key to attach it in right order
401
401
sort .Sort (instanceInterfaces (ifs ))
402
402
if len (ifs ) > 0 {
@@ -533,7 +533,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, m interfa
533
533
return diag .FromErr (err )
534
534
}
535
535
536
- interfaces , err := extractInstanceInterfaceIntoMap (d .Get ("interface" ).(* schema. Set ). List ( ))
536
+ interfaces , err := extractInstanceInterfaceIntoMap (d .Get ("interface" ).([] interface {} ))
537
537
if err != nil {
538
538
return diag .FromErr (err )
539
539
}
@@ -580,7 +580,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, m interfa
580
580
cleanInterfaces = append (cleanInterfaces , i )
581
581
}
582
582
}
583
- if err := d .Set ("interface" , schema . NewSet ( interfaceUniqueID , cleanInterfaces ) ); err != nil {
583
+ if err := d .Set ("interface" , cleanInterfaces ); err != nil {
584
584
return diag .FromErr (err )
585
585
}
586
586
@@ -765,10 +765,10 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, m inter
765
765
if d .HasChange ("interface" ) {
766
766
ifsOldRaw , ifsNewRaw := d .GetChange ("interface" )
767
767
768
- ifsOld := ifsOldRaw .(* schema. Set )
769
- ifsNew := ifsNewRaw .(* schema. Set )
768
+ ifsOld := ifsOldRaw .([] interface {} )
769
+ ifsNew := ifsNewRaw .([] interface {} )
770
770
771
- for _ , i := range ifsOld . List () {
771
+ for _ , i := range ifsOld {
772
772
iface := i .(map [string ]interface {})
773
773
var opts instances.InterfaceOpts
774
774
opts .PortID = iface ["port_id" ].(string )
@@ -793,9 +793,8 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, m inter
793
793
}
794
794
}
795
795
796
- sortedNewIfs := ifsNew .List ()
797
- sort .Sort (instanceInterfaces (sortedNewIfs ))
798
- for _ , i := range sortedNewIfs {
796
+ sort .Sort (instanceInterfaces (ifsNew ))
797
+ for _ , i := range ifsNew {
799
798
iface := i .(map [string ]interface {})
800
799
801
800
iType := types .InterfaceType (iface ["type" ].(string ))
0 commit comments