Class LinuxParametersProps
The properties for defining Linux-specific options that are applied to the container.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LinuxParametersProps : Object, ILinuxParametersProps
Syntax (vb)
Public Class LinuxParametersProps
Inherits Object
Implements ILinuxParametersProps
Remarks
ExampleMetadata: infused
Examples
TaskDefinition taskDefinition;
taskDefinition.AddContainer("container", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
MemoryLimitMiB = 1024,
LinuxParameters = new LinuxParameters(this, "LinuxParameters", new LinuxParametersProps {
InitProcessEnabled = true,
SharedMemorySize = 1024,
MaxSwap = Size.Mebibytes(5000),
Swappiness = 90
})
});
Synopsis
Constructors
LinuxParametersProps() |
Properties
InitProcessEnabled | Specifies whether to run an init process inside the container that forwards signals and reaps processes. |
MaxSwap | The total amount of swap memory a container can use. |
SharedMemorySize | The value for the size of the /dev/shm volume. |
Swappiness | This allows you to tune a container's memory swappiness behavior. |
Constructors
LinuxParametersProps()
public LinuxParametersProps()
Properties
InitProcessEnabled
Specifies whether to run an init process inside the container that forwards signals and reaps processes.
public Nullable<bool> InitProcessEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
MaxSwap
The total amount of swap memory a container can use.
public Size MaxSwap { get; set; }
Property Value
Remarks
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.
SharedMemorySize
The value for the size of the /dev/shm volume.
public Nullable<double> SharedMemorySize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: No shared memory.
Swappiness
This allows you to tune a container's memory swappiness behavior.
public Nullable<double> Swappiness { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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