Class TrackCustomMetricProps
The properties for enabling target tracking scaling based on a custom CloudWatch metric.
Inheritance
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class TrackCustomMetricProps : Object, ITrackCustomMetricProps, IBaseTargetTrackingProps
Syntax (vb)
Public Class TrackCustomMetricProps
Inherits Object
Implements ITrackCustomMetricProps, IBaseTargetTrackingProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK;
Metric metric;
var trackCustomMetricProps = new TrackCustomMetricProps {
Metric = metric,
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
PolicyName = "policyName",
ScaleInCooldown = Duration.Minutes(30),
ScaleOutCooldown = Duration.Minutes(30)
};
Synopsis
Constructors
TrackCustomMetricProps() |
Properties
DisableScaleIn | Indicates whether scale in by the target tracking policy is disabled. |
Metric | The custom CloudWatch metric to track. |
PolicyName | A name for the scaling policy. |
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 custom CloudWatch metric. |
Constructors
TrackCustomMetricProps()
public TrackCustomMetricProps()
Properties
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
Metric
The custom CloudWatch metric to track.
public IMetric Metric { get; set; }
Property Value
Remarks
The metric must represent utilization; that is, you will always get the following behavior:
PolicyName
A name for the scaling policy.
public string PolicyName { get; set; }
Property Value
System.String
Remarks
Default: - Automatically generated name.
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 custom CloudWatch metric.
public double TargetValue { get; set; }
Property Value
System.Double