This commit is contained in:
2026-06-02 11:28:16 +03:00
parent af79f6ab3e
commit c734dcfff7
254 changed files with 10439 additions and 3751 deletions

View File

@@ -88,6 +88,8 @@ func createVinsInAcc(ctx context.Context, d *schema.ResourceData, m interface{},
req.ZoneID = uint64(zoneID.(int))
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
return req, nil
}
@@ -143,6 +145,8 @@ func createVinsInRG(ctx context.Context, d *schema.ResourceData, m interface{},
req.ZoneID = uint64(zoneID.(int))
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
return req, nil
}

View File

@@ -115,12 +115,6 @@ func resourceVinsCreate(ctx context.Context, d *schema.ResourceData, m interface
}
}
if d.Get("enable_secgroups").(bool) {
if err := resourceVinsEnableSecgroups(ctx, d, m, vinsID); err != nil {
warnings.Add(err)
}
}
return append(warnings.Get(), resourceVinsRead(ctx, d, m)...)
}
@@ -437,21 +431,6 @@ func resourceVinsIpReserve(ctx context.Context, d *schema.ResourceData, m interf
return errs
}
func resourceVinsEnableSecgroups(ctx context.Context, d *schema.ResourceData, m interface{}, vinsID uint64) error {
c := m.(*controller.ControllerCfg)
req := vins.UpdateRequest{
VINSID: vinsID,
EnableSecGroups: true,
}
_, err := c.CloudBroker().VINS().Update(ctx, req)
if err != nil {
return err
}
return nil
}
func resourceVinsNatRuleAdd(ctx context.Context, d *schema.ResourceData, m interface{}, vinsId uint64) []error {
var errs []error
c := m.(*controller.ControllerCfg)