-
Notifications
You must be signed in to change notification settings - Fork 17
/
StepScalingPolicyProps.go
85 lines (82 loc) · 3.63 KB
/
StepScalingPolicyProps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package awsapplicationautoscaling
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch"
)
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import cdk "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var metric metric
// var scalableTarget scalableTarget
//
// stepScalingPolicyProps := &StepScalingPolicyProps{
// Metric: metric,
// ScalingSteps: []scalingInterval{
// &scalingInterval{
// Change: jsii.Number(123),
//
// // the properties below are optional
// Lower: jsii.Number(123),
// Upper: jsii.Number(123),
// },
// },
// ScalingTarget: scalableTarget,
//
// // the properties below are optional
// AdjustmentType: awscdk.Aws_applicationautoscaling.AdjustmentType_CHANGE_IN_CAPACITY,
// Cooldown: cdk.Duration_Minutes(jsii.Number(30)),
// DatapointsToAlarm: jsii.Number(123),
// EvaluationPeriods: jsii.Number(123),
// MetricAggregationType: awscdk.*Aws_applicationautoscaling.MetricAggregationType_AVERAGE,
// MinAdjustmentMagnitude: jsii.Number(123),
// }
//
type StepScalingPolicyProps struct {
// Metric to scale on.
Metric awscloudwatch.IMetric `field:"required" json:"metric" yaml:"metric"`
// The intervals for scaling.
//
// Maps a range of metric values to a particular scaling behavior.
ScalingSteps *[]*ScalingInterval `field:"required" json:"scalingSteps" yaml:"scalingSteps"`
// How the adjustment numbers inside 'intervals' are interpreted.
AdjustmentType AdjustmentType `field:"optional" json:"adjustmentType" yaml:"adjustmentType"`
// Grace period after scaling activity.
//
// Subsequent scale outs during the cooldown period are squashed so that only
// the biggest scale out happens.
//
// Subsequent scale ins during the cooldown period are ignored.
// See: https://docs.aws.amazon.com/autoscaling/application/APIReference/API_StepScalingPolicyConfiguration.html
//
Cooldown awscdk.Duration `field:"optional" json:"cooldown" yaml:"cooldown"`
// The number of data points out of the evaluation periods that must be breaching to trigger a scaling action.
//
// Creates an "M out of N" alarm, where this property is the M and the value set for
// `evaluationPeriods` is the N value.
//
// Only has meaning if `evaluationPeriods != 1`.
DatapointsToAlarm *float64 `field:"optional" json:"datapointsToAlarm" yaml:"datapointsToAlarm"`
// How many evaluation periods of the metric to wait before triggering a scaling action.
//
// Raising this value can be used to smooth out the metric, at the expense
// of slower response times.
//
// If `datapointsToAlarm` is not set, then all data points in the evaluation period
// must meet the criteria to trigger a scaling action.
EvaluationPeriods *float64 `field:"optional" json:"evaluationPeriods" yaml:"evaluationPeriods"`
// Aggregation to apply to all data points over the evaluation periods.
//
// Only has meaning if `evaluationPeriods != 1`.
MetricAggregationType MetricAggregationType `field:"optional" json:"metricAggregationType" yaml:"metricAggregationType"`
// Minimum absolute number to adjust capacity with as result of percentage scaling.
//
// Only when using AdjustmentType = PercentChangeInCapacity, this number controls
// the minimum absolute effect size.
MinAdjustmentMagnitude *float64 `field:"optional" json:"minAdjustmentMagnitude" yaml:"minAdjustmentMagnitude"`
// The scaling target.
ScalingTarget IScalableTarget `field:"required" json:"scalingTarget" yaml:"scalingTarget"`
}