Skip to content

Commit

Permalink
feat (ocean/aws) : added ShouldScaleDownNonServiceTasks parameter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra1-n authored Feb 10, 2023
1 parent 386127a commit 63bd932
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
15 changes: 15 additions & 0 deletions examples/service/ocean/providers/aws/createECS/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ func main() {
AvailabilityVsCost: spotinst.String("balanced"),
},
},
AutoScaler: &aws.ECSAutoScaler{
IsEnabled: spotinst.Bool(false),
IsAutoConfig: spotinst.Bool(false),
Cooldown: spotinst.Int(300),

Down: &aws.ECSAutoScalerDown{
MaxScaleDownPercentage: spotinst.Float64(20),
},
ShouldScaleDownNonServiceTasks: spotinst.Bool(true),

ResourceLimits: &aws.ECSAutoScalerResourceLimits{
MaxVCPU: spotinst.Int(1024),
MaxMemoryGiB: spotinst.Int(20),
},
},
Compute: &aws.ECSCompute{
InstanceTypes: &aws.ECSInstanceTypes{
Filters: &aws.ECSFilters{
Expand Down
22 changes: 15 additions & 7 deletions service/ocean/providers/aws/cluster_ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,14 @@ type ECSIAMInstanceProfile struct {
}

type ECSAutoScaler struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
IsAutoConfig *bool `json:"isAutoConfig,omitempty"`
Cooldown *int `json:"cooldown,omitempty"`
Headroom *ECSAutoScalerHeadroom `json:"headroom,omitempty"`
ResourceLimits *ECSAutoScalerResourceLimits `json:"resourceLimits,omitempty"`
Down *ECSAutoScalerDown `json:"down,omitempty"`
AutoHeadroomPercentage *int `json:"autoHeadroomPercentage,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`
IsAutoConfig *bool `json:"isAutoConfig,omitempty"`
Cooldown *int `json:"cooldown,omitempty"`
Headroom *ECSAutoScalerHeadroom `json:"headroom,omitempty"`
ResourceLimits *ECSAutoScalerResourceLimits `json:"resourceLimits,omitempty"`
Down *ECSAutoScalerDown `json:"down,omitempty"`
AutoHeadroomPercentage *int `json:"autoHeadroomPercentage,omitempty"`
ShouldScaleDownNonServiceTasks *bool `json:"shouldScaleDownNonServiceTasks,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -1104,6 +1105,13 @@ func (o *ECSAutoScaler) SetAutoHeadroomPercentage(v *int) *ECSAutoScaler {
return o
}

func (o *ECSAutoScaler) SetShouldScaleDownNonServiceTasks(v *bool) *ECSAutoScaler {
if o.ShouldScaleDownNonServiceTasks = v; o.ShouldScaleDownNonServiceTasks == nil {
o.nullFields = append(o.nullFields, "ShouldScaleDownNonServiceTasks")
}
return o
}

// endregion

// region AutoScalerHeadroom
Expand Down

0 comments on commit 63bd932

Please sign in to comment.