Class: AWSCDK::ECS::CfnTaskDefinition::LinuxParametersProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::CfnTaskDefinition::LinuxParametersProperty
- Defined in:
- ecs/cfn_task_definition.rb
Overview
The Linux-specific options that are applied to the container, such as Linux KernelCapabilities .
Instance Attribute Summary collapse
-
#capabilities ⇒ AWSCDK::IResolvable, ...
readonly
The Linux capabilities for the container that are added to or dropped from the default configuration provided by Docker.
-
#devices ⇒ AWSCDK::IResolvable, ...
readonly
Any host devices to expose to the container.
-
#init_process_enabled ⇒ Boolean, ...
readonly
Run an
initprocess inside the container that forwards signals and reaps processes. -
#max_swap ⇒ Numeric?
readonly
The total amount of swap memory (in MiB) a container can use.
-
#shared_memory_size ⇒ Numeric?
readonly
The value for the size (in MiB) of the
/dev/shmvolume. -
#swappiness ⇒ Numeric?
readonly
This allows you to tune a container's memory swappiness behavior.
-
#tmpfs ⇒ AWSCDK::IResolvable, ...
readonly
The container path, mount options, and size (in MiB) of the tmpfs mount.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(capabilities: nil, devices: nil, init_process_enabled: nil, max_swap: nil, shared_memory_size: nil, swappiness: nil, tmpfs: nil) ⇒ LinuxParametersProperty
constructor
A new instance of LinuxParametersProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(capabilities: nil, devices: nil, init_process_enabled: nil, max_swap: nil, shared_memory_size: nil, swappiness: nil, tmpfs: nil) ⇒ LinuxParametersProperty
Returns a new instance of LinuxParametersProperty.
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 |
# File 'ecs/cfn_task_definition.rb', line 2349 def initialize(capabilities: nil, devices: nil, init_process_enabled: nil, max_swap: nil, shared_memory_size: nil, swappiness: nil, tmpfs: nil) @capabilities = capabilities.is_a?(Hash) ? ::AWSCDK::ECS::CfnTaskDefinition::KernelCapabilitiesProperty.new(**capabilities.transform_keys(&:to_sym)) : capabilities Jsii::Type.check_type(@capabilities, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuVGFza0RlZmluaXRpb24uS2VybmVsQ2FwYWJpbGl0aWVzUHJvcGVydHkifV19fQ==")), "capabilities") unless @capabilities.nil? @devices = devices Jsii::Type.check_type(@devices, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblRhc2tEZWZpbml0aW9uLkRldmljZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "devices") unless @devices.nil? @init_process_enabled = init_process_enabled Jsii::Type.check_type(@init_process_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "initProcessEnabled") unless @init_process_enabled.nil? @max_swap = max_swap Jsii::Type.check_type(@max_swap, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSwap") unless @max_swap.nil? @shared_memory_size = shared_memory_size Jsii::Type.check_type(@shared_memory_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "sharedMemorySize") unless @shared_memory_size.nil? @swappiness = swappiness Jsii::Type.check_type(@swappiness, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "swappiness") unless @swappiness.nil? @tmpfs = tmpfs Jsii::Type.check_type(@tmpfs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblRhc2tEZWZpbml0aW9uLlRtcGZzUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "tmpfs") unless @tmpfs.nil? end |
Instance Attribute Details
#capabilities ⇒ AWSCDK::IResolvable, ... (readonly)
The Linux capabilities for the container that are added to or dropped from the default configuration provided by Docker.
For tasks that use the Fargate launch type,
capabilitiesis supported for all platform versions but theaddparameter is only supported if using platform version 1.4.0 or later.
2372 2373 2374 |
# File 'ecs/cfn_task_definition.rb', line 2372 def capabilities @capabilities end |
#devices ⇒ AWSCDK::IResolvable, ... (readonly)
Any host devices to expose to the container.
This parameter maps to Devices in the docker container create command and the --device option to docker run.
If you're using tasks that use the Fargate launch type, the
devicesparameter isn't supported.
2381 2382 2383 |
# File 'ecs/cfn_task_definition.rb', line 2381 def devices @devices end |
#init_process_enabled ⇒ Boolean, ... (readonly)
Run an init process inside the container that forwards signals and reaps processes.
This parameter maps to the --init option to docker run. This parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'
2388 2389 2390 |
# File 'ecs/cfn_task_definition.rb', line 2388 def init_process_enabled @init_process_enabled end |
#max_swap ⇒ Numeric? (readonly)
The total amount of swap memory (in MiB) a container can use.
This parameter will be translated to the --memory-swap option to docker run where the value would be the sum of the container memory plus the max_swap value.
If a max_swap value of 0 is specified, the container will not use swap. Accepted values are 0 or any positive integer. If the max_swap parameter is omitted, the container will use the swap configuration for the container instance it is running on. A max_swap value must be set for the swappiness parameter to be used.
If you're using tasks that use the Fargate launch type, the
max_swapparameter isn't supported.If you're using tasks on Amazon Linux 2023 the
swappinessparameter isn't supported.
2401 2402 2403 |
# File 'ecs/cfn_task_definition.rb', line 2401 def max_swap @max_swap end |
#shared_memory_size ⇒ Numeric? (readonly)
The value for the size (in MiB) of the /dev/shm volume.
This parameter maps to the --shm-size option to docker run.
If you are using tasks that use the Fargate launch type, the
shared_memory_sizeparameter is not supported.
2410 2411 2412 |
# File 'ecs/cfn_task_definition.rb', line 2410 def shared_memory_size @shared_memory_size end |
#swappiness ⇒ Numeric? (readonly)
This allows you to tune a container's memory swappiness behavior.
A swappiness value of 0 will cause swapping to not happen unless absolutely necessary. A swappiness value of 100 will cause pages to be swapped very aggressively. Accepted values are whole numbers between 0 and 100 . If the swappiness parameter is not specified, a default value of 60 is used. If a value is not specified for max_swap then this parameter is ignored. This parameter maps to the --memory-swappiness option to docker run.
If you're using tasks that use the Fargate launch type, the
swappinessparameter isn't supported.If you're using tasks on Amazon Linux 2023 the
swappinessparameter isn't supported.
2421 2422 2423 |
# File 'ecs/cfn_task_definition.rb', line 2421 def swappiness @swappiness end |
#tmpfs ⇒ AWSCDK::IResolvable, ... (readonly)
The container path, mount options, and size (in MiB) of the tmpfs mount.
This parameter maps to the --tmpfs option to docker run.
If you're using tasks that use the Fargate launch type, the
tmpfsparameter isn't supported.
2430 2431 2432 |
# File 'ecs/cfn_task_definition.rb', line 2430 def tmpfs @tmpfs end |
Class Method Details
.jsii_properties ⇒ Object
2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 |
# File 'ecs/cfn_task_definition.rb', line 2432 def self.jsii_properties { :capabilities => "capabilities", :devices => "devices", :init_process_enabled => "initProcessEnabled", :max_swap => "maxSwap", :shared_memory_size => "sharedMemorySize", :swappiness => "swappiness", :tmpfs => "tmpfs", } end |
Instance Method Details
#to_jsii ⇒ Object
2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 |
# File 'ecs/cfn_task_definition.rb', line 2444 def to_jsii result = {} result.merge!({ "capabilities" => @capabilities, "devices" => @devices, "initProcessEnabled" => @init_process_enabled, "maxSwap" => @max_swap, "sharedMemorySize" => @shared_memory_size, "swappiness" => @swappiness, "tmpfs" => @tmpfs, }) result.compact end |