AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

LinuxParameters

Linux-specific options that are applied to the container.

Import

import { LinuxParameters } from 'aws-cdk-lib/aws-ecs';

Or use the module namespace:

import * as ecs from 'aws-cdk-lib/aws-ecs';
// ecs.LinuxParameters

Properties

Configuration passed to the constructor as LinuxParametersProps.

initProcessEnabledOptional
boolean

Specifies whether to run an init process inside the container that forwards signals and reaps processes.

Default: false

maxSwapOptional
Size

The total amount of swap memory a container can use. 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.

Default: No swap.

sharedMemorySizeOptional
number

The value for the size of the /dev/shm volume.

Default: No shared memory.

swappinessOptional
number

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.

Default: 60

Get the Amazon ECS Cheat Sheet

Everything you need to know about Amazon ECS on one page. HD quality, print-friendly.

Download Free Infographic