# LinuxParameters

Linux-specific options that are applied to the container.

Extends: Construct › LinuxParameters
Implements: IConstruct, IDependable

- Source: [`aws-batch/lib/linux-parameters.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-batch/lib/linux-parameters.ts#L57)
- Type last changed: v2.254.0 · 13 May 2026

## Example

```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 linuxParameters = new batch.LinuxParameters(this, 'MyLinuxParameters', /* all optional props */ {
  initProcessEnabled: false,
  maxSwap: size,
  sharedMemorySize: size,
  swappiness: 123,
});
```

## Initializer

```ts
new LinuxParameters(scope: Construct, id: string, props?: LinuxParametersProps)
```

## Construct Props

- `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.

## Properties

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

## Methods

- `addDevices(...device: Device[]): void` — Adds one or more host devices to a container.

- `addTmpfs(...tmpfs: Tmpfs[]): void` — Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container.

  Only works with EC2 launch type.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `renderLinuxParameters(): CfnJobDefinition.LinuxParametersProperty` — Renders the Linux parameters to the Batch version of this resource, which does not have 'capabilities' and requires tmpfs.containerPath to be defined.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
