/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ECS { namespace Model { /** *

The Linux-specific options that are applied to the container, such as Linux * KernelCapabilities.

See * Also:

AWS * API Reference

*/ class LinuxParameters { public: AWS_ECS_API LinuxParameters(); AWS_ECS_API LinuxParameters(Aws::Utils::Json::JsonView jsonValue); AWS_ECS_API LinuxParameters& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_ECS_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline const KernelCapabilities& GetCapabilities() const{ return m_capabilities; } /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline bool CapabilitiesHasBeenSet() const { return m_capabilitiesHasBeenSet; } /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline void SetCapabilities(const KernelCapabilities& value) { m_capabilitiesHasBeenSet = true; m_capabilities = value; } /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline void SetCapabilities(KernelCapabilities&& value) { m_capabilitiesHasBeenSet = true; m_capabilities = std::move(value); } /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline LinuxParameters& WithCapabilities(const KernelCapabilities& value) { SetCapabilities(value); return *this;} /** *

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, capabilities is supported for all platform * versions but the add parameter is only supported if using platform * version 1.4.0 or later.

*/ inline LinuxParameters& WithCapabilities(KernelCapabilities&& value) { SetCapabilities(std::move(value)); return *this;} /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline const Aws::Vector& GetDevices() const{ return m_devices; } /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline bool DevicesHasBeenSet() const { return m_devicesHasBeenSet; } /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline void SetDevices(const Aws::Vector& value) { m_devicesHasBeenSet = true; m_devices = value; } /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline void SetDevices(Aws::Vector&& value) { m_devicesHasBeenSet = true; m_devices = std::move(value); } /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline LinuxParameters& WithDevices(const Aws::Vector& value) { SetDevices(value); return *this;} /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline LinuxParameters& WithDevices(Aws::Vector&& value) { SetDevices(std::move(value)); return *this;} /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline LinuxParameters& AddDevices(const Device& value) { m_devicesHasBeenSet = true; m_devices.push_back(value); return *this; } /** *

Any host devices to expose to the container. This parameter maps to * Devices in the Create * a container section of the Docker Remote API and the * --device option to docker * run.

If you're using tasks that use the Fargate launch type, * the devices parameter isn't supported.

*/ inline LinuxParameters& AddDevices(Device&& value) { m_devicesHasBeenSet = true; m_devices.push_back(std::move(value)); return *this; } /** *

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}}'

*/ inline bool GetInitProcessEnabled() const{ return m_initProcessEnabled; } /** *

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}}'

*/ inline bool InitProcessEnabledHasBeenSet() const { return m_initProcessEnabledHasBeenSet; } /** *

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}}'

*/ inline void SetInitProcessEnabled(bool value) { m_initProcessEnabledHasBeenSet = true; m_initProcessEnabled = value; } /** *

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}}'

*/ inline LinuxParameters& WithInitProcessEnabled(bool value) { SetInitProcessEnabled(value); return *this;} /** *

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 sharedMemorySize parameter is not supported.

*/ inline int GetSharedMemorySize() const{ return m_sharedMemorySize; } /** *

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 sharedMemorySize parameter is not supported.

*/ inline bool SharedMemorySizeHasBeenSet() const { return m_sharedMemorySizeHasBeenSet; } /** *

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 sharedMemorySize parameter is not supported.

*/ inline void SetSharedMemorySize(int value) { m_sharedMemorySizeHasBeenSet = true; m_sharedMemorySize = value; } /** *

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 sharedMemorySize parameter is not supported.

*/ inline LinuxParameters& WithSharedMemorySize(int value) { SetSharedMemorySize(value); return *this;} /** *

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 tmpfs parameter isn't supported.

*/ inline const Aws::Vector& GetTmpfs() const{ return m_tmpfs; } /** *

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 tmpfs parameter isn't supported.

*/ inline bool TmpfsHasBeenSet() const { return m_tmpfsHasBeenSet; } /** *

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 tmpfs parameter isn't supported.

*/ inline void SetTmpfs(const Aws::Vector& value) { m_tmpfsHasBeenSet = true; m_tmpfs = value; } /** *

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 tmpfs parameter isn't supported.

*/ inline void SetTmpfs(Aws::Vector&& value) { m_tmpfsHasBeenSet = true; m_tmpfs = std::move(value); } /** *

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 tmpfs parameter isn't supported.

*/ inline LinuxParameters& WithTmpfs(const Aws::Vector& value) { SetTmpfs(value); return *this;} /** *

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 tmpfs parameter isn't supported.

*/ inline LinuxParameters& WithTmpfs(Aws::Vector&& value) { SetTmpfs(std::move(value)); return *this;} /** *

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 tmpfs parameter isn't supported.

*/ inline LinuxParameters& AddTmpfs(const Tmpfs& value) { m_tmpfsHasBeenSet = true; m_tmpfs.push_back(value); return *this; } /** *

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 tmpfs parameter isn't supported.

*/ inline LinuxParameters& AddTmpfs(Tmpfs&& value) { m_tmpfsHasBeenSet = true; m_tmpfs.push_back(std::move(value)); return *this; } /** *

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 * maxSwap value.

If a maxSwap value of * 0 is specified, the container will not use swap. Accepted values * are 0 or any positive integer. If the maxSwap * parameter is omitted, the container will use the swap configuration for the * container instance it is running on. A maxSwap value must be set * for the swappiness parameter to be used.

If you're * using tasks that use the Fargate launch type, the maxSwap parameter * isn't supported.

If you're using tasks on Amazon Linux 2023 the * swappiness parameter isn't supported.

*/ inline int GetMaxSwap() const{ return m_maxSwap; } /** *

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 * maxSwap value.

If a maxSwap value of * 0 is specified, the container will not use swap. Accepted values * are 0 or any positive integer. If the maxSwap * parameter is omitted, the container will use the swap configuration for the * container instance it is running on. A maxSwap value must be set * for the swappiness parameter to be used.

If you're * using tasks that use the Fargate launch type, the maxSwap parameter * isn't supported.

If you're using tasks on Amazon Linux 2023 the * swappiness parameter isn't supported.

*/ inline bool MaxSwapHasBeenSet() const { return m_maxSwapHasBeenSet; } /** *

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 * maxSwap value.

If a maxSwap value of * 0 is specified, the container will not use swap. Accepted values * are 0 or any positive integer. If the maxSwap * parameter is omitted, the container will use the swap configuration for the * container instance it is running on. A maxSwap value must be set * for the swappiness parameter to be used.

If you're * using tasks that use the Fargate launch type, the maxSwap parameter * isn't supported.

If you're using tasks on Amazon Linux 2023 the * swappiness parameter isn't supported.

*/ inline void SetMaxSwap(int value) { m_maxSwapHasBeenSet = true; m_maxSwap = value; } /** *

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 * maxSwap value.

If a maxSwap value of * 0 is specified, the container will not use swap. Accepted values * are 0 or any positive integer. If the maxSwap * parameter is omitted, the container will use the swap configuration for the * container instance it is running on. A maxSwap value must be set * for the swappiness parameter to be used.

If you're * using tasks that use the Fargate launch type, the maxSwap parameter * isn't supported.

If you're using tasks on Amazon Linux 2023 the * swappiness parameter isn't supported.

*/ inline LinuxParameters& WithMaxSwap(int value) { SetMaxSwap(value); return *this;} /** *

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 maxSwap * 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 swappiness parameter isn't supported.

If you're using * tasks on Amazon Linux 2023 the swappiness parameter isn't * supported.

*/ inline int GetSwappiness() const{ return m_swappiness; } /** *

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 maxSwap * 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 swappiness parameter isn't supported.

If you're using * tasks on Amazon Linux 2023 the swappiness parameter isn't * supported.

*/ inline bool SwappinessHasBeenSet() const { return m_swappinessHasBeenSet; } /** *

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 maxSwap * 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 swappiness parameter isn't supported.

If you're using * tasks on Amazon Linux 2023 the swappiness parameter isn't * supported.

*/ inline void SetSwappiness(int value) { m_swappinessHasBeenSet = true; m_swappiness = value; } /** *

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 maxSwap * 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 swappiness parameter isn't supported.

If you're using * tasks on Amazon Linux 2023 the swappiness parameter isn't * supported.

*/ inline LinuxParameters& WithSwappiness(int value) { SetSwappiness(value); return *this;} private: KernelCapabilities m_capabilities; bool m_capabilitiesHasBeenSet = false; Aws::Vector m_devices; bool m_devicesHasBeenSet = false; bool m_initProcessEnabled; bool m_initProcessEnabledHasBeenSet = false; int m_sharedMemorySize; bool m_sharedMemorySizeHasBeenSet = false; Aws::Vector m_tmpfs; bool m_tmpfsHasBeenSet = false; int m_maxSwap; bool m_maxSwapHasBeenSet = false; int m_swappiness; bool m_swappinessHasBeenSet = false; }; } // namespace Model } // namespace ECS } // namespace Aws