# LinuxParametersProps

The properties for defining Linux-specific options that are applied to the container.

Used as props by: [LinuxParameters](/cdk/api/v2/docs/aws-cdk-lib.aws_batch.LinuxParameters.html)

- Source: [`aws-batch/lib/linux-parameters.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-batch/lib/linux-parameters.ts#L12)
- 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 * as cdk from 'aws-cdk-lib';
import { aws_batch as batch } from 'aws-cdk-lib';

declare const size: cdk.Size;
const linuxParametersProps: batch.LinuxParametersProps = {
  initProcessEnabled: false,
  maxSwap: size,
  sharedMemorySize: size,
  swappiness: 123,
};
```

Python:

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

# size: cdk.Size

linux_parameters_props = batch.LinuxParametersProps(
    init_process_enabled=False,
    max_swap=size,
    shared_memory_size=size,
    swappiness=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.*;
import software.amazon.awscdk.services.batch.*;

Size size;

LinuxParametersProps linuxParametersProps = LinuxParametersProps.builder()
        .initProcessEnabled(false)
        .maxSwap(size)
        .sharedMemorySize(size)
        .swappiness(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;
using Amazon.CDK.AWS.Batch;

Size size;

var linuxParametersProps = new LinuxParametersProps {
    InitProcessEnabled = false,
    MaxSwap = size,
    SharedMemorySize = size,
    Swappiness = 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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var size Size

linuxParametersProps := &LinuxParametersProps{
	InitProcessEnabled: jsii.Boolean(false),
	MaxSwap: size,
	SharedMemorySize: size,
	Swappiness: jsii.Number(123),
}
```

## Properties

- `initProcessEnabled`: boolean = false — Specifies whether to run an init process inside the container that forwards signals and reaps processes.

- `maxSwap`: [Size](/cdk/api/v2/docs/aws-cdk-lib.Size.html) — The total amount of swap memory a container can use.

  **Default:** No swap.

  This parameter
  will be translated to the --memory-swap option to docker run.

  This parameter is only supported when you are using the EC2 launch type.
  Accepted values are positive integers.

- `sharedMemorySize`: [Size](/cdk/api/v2/docs/aws-cdk-lib.Size.html) — The value for the size of the /dev/shm volume.

  **Default:** No shared memory.

- `swappiness`: number = 60 — This allows you to tune a container's memory swappiness behavior.

  This parameter
  maps to the --memory-swappiness option to docker run. The swappiness relates
  to the kernel's tendency to swap memory. A value of 0 will cause swapping to
  not happen unless absolutely necessary. A value of 100 will cause pages to
  be swapped very aggressively.

  This parameter is only supported when you are using the EC2 launch type.
  Accepted values are whole numbers between 0 and 100. If a value is not
  specified for maxSwap then this parameter is ignored.
