Class ScalableTaskCount
The scalable attribute representing task count.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ScalableTaskCount : BaseScalableAttribute
Syntax (vb)
Public Class ScalableTaskCount
Inherits BaseScalableAttribute
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var loadBalancedFargateService = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
Cluster = cluster,
MemoryLimitMiB = 1024,
DesiredCount = 1,
Cpu = 512,
TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
}
});
var scalableTarget = loadBalancedFargateService.Service.AutoScaleTaskCount(new EnableScalingProps {
MinCapacity = 1,
MaxCapacity = 20
});
scalableTarget.ScaleOnCpuUtilization("CpuScaling", new CpuUtilizationScalingProps {
TargetUtilizationPercent = 50
});
scalableTarget.ScaleOnMemoryUtilization("MemoryScaling", new MemoryUtilizationScalingProps {
TargetUtilizationPercent = 50
});
Synopsis
Constructors
ScalableTaskCount(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ScalableTaskCount(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ScalableTaskCount(Construct, String, IScalableTaskCountProps) | Constructs a new instance of the ScalableTaskCount class. |
Methods
ScaleOnCpuUtilization(String, ICpuUtilizationScalingProps) | Scales in or out to achieve a target CPU utilization. |
ScaleOnMemoryUtilization(String, IMemoryUtilizationScalingProps) | Scales in or out to achieve a target memory utilization. |
ScaleOnMetric(String, IBasicStepScalingPolicyProps) | Scales in or out based on a specified metric value. |
ScaleOnRequestCount(String, IRequestCountScalingProps) | Scales in or out to achieve a target Application Load Balancer request count per target. |
ScaleOnSchedule(String, IScalingSchedule) | Scales in or out based on a specified scheduled time. |
ScaleToTrackCustomMetric(String, ITrackCustomMetricProps) | Scales in or out to achieve a target on a custom metric. |
Constructors
ScalableTaskCount(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ScalableTaskCount(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ScalableTaskCount(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ScalableTaskCount(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ScalableTaskCount(Construct, String, IScalableTaskCountProps)
Constructs a new instance of the ScalableTaskCount class.
public ScalableTaskCount(Construct scope, string id, IScalableTaskCountProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IScalableTaskCountProps
Methods
ScaleOnCpuUtilization(String, ICpuUtilizationScalingProps)
Scales in or out to achieve a target CPU utilization.
public virtual void ScaleOnCpuUtilization(string id, ICpuUtilizationScalingProps props)
Parameters
- id System.String
- props ICpuUtilizationScalingProps
ScaleOnMemoryUtilization(String, IMemoryUtilizationScalingProps)
Scales in or out to achieve a target memory utilization.
public virtual void ScaleOnMemoryUtilization(string id, IMemoryUtilizationScalingProps props)
Parameters
- id System.String
- props IMemoryUtilizationScalingProps
ScaleOnMetric(String, IBasicStepScalingPolicyProps)
Scales in or out based on a specified metric value.
public virtual void ScaleOnMetric(string id, IBasicStepScalingPolicyProps props)
Parameters
- id System.String
- props IBasicStepScalingPolicyProps
ScaleOnRequestCount(String, IRequestCountScalingProps)
Scales in or out to achieve a target Application Load Balancer request count per target.
public virtual void ScaleOnRequestCount(string id, IRequestCountScalingProps props)
Parameters
- id System.String
- props IRequestCountScalingProps
ScaleOnSchedule(String, IScalingSchedule)
Scales in or out based on a specified scheduled time.
public virtual void ScaleOnSchedule(string id, IScalingSchedule props)
Parameters
- id System.String
- props IScalingSchedule
ScaleToTrackCustomMetric(String, ITrackCustomMetricProps)
Scales in or out to achieve a target on a custom metric.
public virtual void ScaleToTrackCustomMetric(string id, ITrackCustomMetricProps props)
Parameters
- id System.String
- props ITrackCustomMetricProps