Class BasicTargetTrackingScalingPolicyProps
Properties for a Target Tracking policy that include the metric but exclude the target.
Inheritance
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BasicTargetTrackingScalingPolicyProps : Object, IBasicTargetTrackingScalingPolicyProps, IBaseTargetTrackingProps
Syntax (vb)
Public Class BasicTargetTrackingScalingPolicyProps
Inherits Object
Implements IBasicTargetTrackingScalingPolicyProps, IBaseTargetTrackingProps
Remarks
ExampleMetadata: infused
Examples
var shardsScalableTarget = new ScalableTarget(this, "ElastiCacheRedisShardsScalableTarget", new ScalableTargetProps {
ServiceNamespace = ServiceNamespace.ELASTICACHE,
ScalableDimension = "elasticache:replication-group:NodeGroups",
MinCapacity = 2,
MaxCapacity = 10,
ResourceId = "replication-group/main-cluster"
});
shardsScalableTarget.ScaleToTrackMetric("ElastiCacheRedisShardsCPUUtilization", new BasicTargetTrackingScalingPolicyProps {
TargetValue = 20,
PredefinedMetric = PredefinedMetric.ELASTICACHE_PRIMARY_ENGINE_CPU_UTILIZATION
});
Synopsis
Constructors
BasicTargetTrackingScalingPolicyProps() |
Properties
CustomMetric | A custom metric for application autoscaling. |
DisableScaleIn | Indicates whether scale in by the target tracking policy is disabled. |
PolicyName | A name for the scaling policy. |
PredefinedMetric | A predefined metric for application autoscaling. |
ResourceLabel | Identify the resource associated with the metric type. |
ScaleInCooldown | Period after a scale in activity completes before another scale in activity can start. |
ScaleOutCooldown | Period after a scale out activity completes before another scale out activity can start. |
TargetValue | The target value for the metric. |
Constructors
BasicTargetTrackingScalingPolicyProps()
public BasicTargetTrackingScalingPolicyProps()
Properties
CustomMetric
A custom metric for application autoscaling.
public IMetric CustomMetric { get; set; }
Property Value
Remarks
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
Default: - No custom metric.
DisableScaleIn
Indicates whether scale in by the target tracking policy is disabled.
public Nullable<bool> DisableScaleIn { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
Default: false
PolicyName
A name for the scaling policy.
public string PolicyName { get; set; }
Property Value
System.String
Remarks
Default: - Automatically generated name.
PredefinedMetric
A predefined metric for application autoscaling.
public Nullable<PredefinedMetric> PredefinedMetric { get; set; }
Property Value
System.Nullable<PredefinedMetric>
Remarks
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
Default: - No predefined metrics.
ResourceLabel
Identify the resource associated with the metric type.
public string ResourceLabel { get; set; }
Property Value
System.String
Remarks
Only used for predefined metric ALBRequestCountPerTarget.
Example value: app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>
Default: - No resource label.
ScaleInCooldown
Period after a scale in activity completes before another scale in activity can start.
public Duration ScaleInCooldown { get; set; }
Property Value
Remarks
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
ScaleOutCooldown
Period after a scale out activity completes before another scale out activity can start.
public Duration ScaleOutCooldown { get; set; }
Property Value
Remarks
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
TargetValue
The target value for the metric.
public double TargetValue { get; set; }
Property Value
System.Double