# Ulimit

Sets limits for a resource with `ulimit` on linux systems.

Used by the Docker daemon.

Used as argument in: [IEcsEc2ContainerDefinition.addUlimit](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.IEcsEc2ContainerDefinition.html#addulimit)

- Source: [`aws-batch/lib/ecs-container-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-batch/lib/ecs-container-definition.ts#L815)
- Type last changed: v2.96.0 · 13 Sep 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_batch as batch } from 'aws-cdk-lib';
const ulimit: batch.Ulimit = {
  hardLimit: 123,
  name: batch.UlimitName.CORE,
  softLimit: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch

ulimit = batch.Ulimit(
    hard_limit=123,
    name=batch.UlimitName.CORE,
    soft_limit=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.batch.*;

Ulimit ulimit = Ulimit.builder()
        .hardLimit(123)
        .name(UlimitName.CORE)
        .softLimit(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Batch;

var ulimit = new Ulimit {
    HardLimit = 123,
    Name = UlimitName.CORE,
    SoftLimit = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

ulimit := &Ulimit{
	HardLimit: jsii.Number(123),
	Name: awscdk.Aws_batch.UlimitName_CORE,
	SoftLimit: jsii.Number(123),
}
```

## Properties

- `hardLimit`: number (required) — The hard limit for this resource.

  The container will
  be terminated if it exceeds this limit.

- `name`: [UlimitName](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.UlimitName.html) (required) — The resource to limit.

- `softLimit`: number (required) — The reservation for this resource.

  The container will
  not be terminated if it exceeds this limit.
