# NetworkUtilizationScalingProps

Properties for enabling scaling based on network utilization.

Extends: [BaseTargetTrackingProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.BaseTargetTrackingProps.html)
Used as argument in: [IAutoScalingGroup.scaleOnIncomingBytes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.IAutoScalingGroup.html#scaleonincomingbytes), IAutoScalingGroup.scaleOnOutgoingBytes

- Source: [`aws-autoscaling/lib/auto-scaling-group.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L2939)

## Example

TypeScript:

```ts
declare const autoScalingGroup: autoscaling.AutoScalingGroup;

autoScalingGroup.scaleOnIncomingBytes('LimitIngressPerInstance', {
    targetBytesPerSecond: 10 * 1024 * 1024 // 10 MB/s
});
autoScalingGroup.scaleOnOutgoingBytes('LimitEgressPerInstance', {
    targetBytesPerSecond: 10 * 1024 * 1024 // 10 MB/s
});
```

Python:

```python
# auto_scaling_group: autoscaling.AutoScalingGroup

auto_scaling_group.scale_on_incoming_bytes("LimitIngressPerInstance",
    target_bytes_per_second=10 * 1024 * 1024
)
auto_scaling_group.scale_on_outgoing_bytes("LimitEgressPerInstance",
    target_bytes_per_second=10 * 1024 * 1024
)
```

Java:

```java
AutoScalingGroup autoScalingGroup;

autoScalingGroup.scaleOnIncomingBytes("LimitIngressPerInstance", NetworkUtilizationScalingProps.builder()
        .targetBytesPerSecond(10 * 1024 * 1024)
        .build());
autoScalingGroup.scaleOnOutgoingBytes("LimitEgressPerInstance", NetworkUtilizationScalingProps.builder()
        .targetBytesPerSecond(10 * 1024 * 1024)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
AutoScalingGroup autoScalingGroup;

autoScalingGroup.ScaleOnIncomingBytes("LimitIngressPerInstance", new NetworkUtilizationScalingProps {
    TargetBytesPerSecond = 10 * 1024 * 1024
});
autoScalingGroup.ScaleOnOutgoingBytes("LimitEgressPerInstance", new NetworkUtilizationScalingProps {
    TargetBytesPerSecond = 10 * 1024 * 1024
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var autoScalingGroup AutoScalingGroup

autoScalingGroup.scaleOnIncomingBytes(jsii.String("LimitIngressPerInstance"), &NetworkUtilizationScalingProps{
	TargetBytesPerSecond: jsii.Number(10 * 1024 * 1024),
})
autoScalingGroup.scaleOnOutgoingBytes(jsii.String("LimitEgressPerInstance"), &NetworkUtilizationScalingProps{
	TargetBytesPerSecond: jsii.Number(10 * 1024 * 1024),
})
```

## Properties

- `cooldown`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Period after a scaling completes before another scaling activity can start.

  **Default:** The default cooldown configured on the AutoScalingGroup.

- `disableScaleIn`: boolean = false — Indicates whether scale in by the target tracking policy is disabled.

  If the value is true, scale in is disabled and the target tracking policy
  won't remove capacity from the autoscaling group. Otherwise, scale in is
  enabled and the target tracking policy can remove capacity from the
  group.

- `estimatedInstanceWarmup`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Estimated time until a newly launched instance can send metrics to CloudWatch.

  **Default:** Same as the cooldown.

- `targetBytesPerSecond`: number (required) — Target average bytes/seconds on each instance.
