Class: AWSCDK::ECS::FargateTaskDefinitionProps
- Inherits:
-
CommonTaskDefinitionProps
- Object
- CommonTaskDefinitionProps
- AWSCDK::ECS::FargateTaskDefinitionProps
- Defined in:
- ecs/fargate_task_definition_props.rb
Overview
The properties for a task definition.
Instance Attribute Summary collapse
-
#cpu ⇒ Numeric?
readonly
The number of cpu units used by the task.
-
#enable_fault_injection ⇒ Boolean?
readonly
Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
-
#ephemeral_storage_gib ⇒ Numeric?
readonly
The amount (in GiB) of ephemeral storage to be allocated to the task.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
-
#family ⇒ String?
readonly
The name of a family that this task definition is registered to.
-
#memory_limit_mib ⇒ Numeric?
readonly
The amount (in MiB) of memory used by the task.
-
#pid_mode ⇒ AWSCDK::ECS::PidMode?
readonly
The process namespace to use for the containers in the task.
-
#proxy_configuration ⇒ AWSCDK::ECS::ProxyConfiguration?
readonly
The configuration details for the App Mesh proxy.
-
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform?
readonly
The operating system that your task definitions are running on.
-
#task_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
-
#volumes ⇒ Array<AWSCDK::ECS::Volume>?
readonly
The list of volume definitions for the task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, pid_mode: nil, runtime_platform: nil) ⇒ FargateTaskDefinitionProps
constructor
A new instance of FargateTaskDefinitionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, pid_mode: nil, runtime_platform: nil) ⇒ FargateTaskDefinitionProps
Returns a new instance of FargateTaskDefinitionProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'ecs/fargate_task_definition_props.rb', line 18 def initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, pid_mode: nil, runtime_platform: nil) @enable_fault_injection = enable_fault_injection Jsii::Type.check_type(@enable_fault_injection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableFaultInjection") unless @enable_fault_injection.nil? @execution_role = execution_role Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil? @family = family Jsii::Type.check_type(@family, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "family") unless @family.nil? @proxy_configuration = proxy_configuration Jsii::Type.check_type(@proxy_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3h5Q29uZmlndXJhdGlvbiJ9")), "proxyConfiguration") unless @proxy_configuration.nil? @task_role = task_role Jsii::Type.check_type(@task_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "taskRole") unless @task_role.nil? @volumes = volumes.is_a?(Array) ? volumes.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Volume.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : volumes Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuVm9sdW1lIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "volumes") unless @volumes.nil? @cpu = cpu Jsii::Type.check_type(@cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpu") unless @cpu.nil? @ephemeral_storage_gib = ephemeral_storage_gib Jsii::Type.check_type(@ephemeral_storage_gib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ephemeralStorageGiB") unless @ephemeral_storage_gib.nil? @memory_limit_mib = memory_limit_mib Jsii::Type.check_type(@memory_limit_mib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryLimitMiB") unless @memory_limit_mib.nil? @pid_mode = pid_mode Jsii::Type.check_type(@pid_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlBpZE1vZGUifQ==")), "pidMode") unless @pid_mode.nil? @runtime_platform = runtime_platform.is_a?(Hash) ? ::AWSCDK::ECS::RuntimePlatform.new(**runtime_platform.transform_keys(&:to_sym)) : runtime_platform Jsii::Type.check_type(@runtime_platform, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlJ1bnRpbWVQbGF0Zm9ybSJ9")), "runtimePlatform") unless @runtime_platform.nil? end |
Instance Attribute Details
#cpu ⇒ Numeric? (readonly)
Default: 256
The number of cpu units used by the task.
For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB)
512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB)
1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB)
4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB)
8192 (8 vCPU) - Available memory values: Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB)
16384 (16 vCPU) - Available memory values: Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB)
Note: For windows platforms, this field is not enforced at runtime. However, it is still required as it is used to determine the instance type and size that tasks run on.
107 108 109 |
# File 'ecs/fargate_task_definition_props.rb', line 107 def cpu @cpu end |
#enable_fault_injection ⇒ Boolean? (readonly)
Default: undefined - ECS default setting is false
Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
Fault injection only works with tasks using the NetworkMode.AWS_VPC or NetworkMode.HOST network modes.
49 50 51 |
# File 'ecs/fargate_task_definition_props.rb', line 49 def enable_fault_injection @enable_fault_injection end |
#ephemeral_storage_gib ⇒ Numeric? (readonly)
Default: 20
The amount (in GiB) of ephemeral storage to be allocated to the task.
The maximum supported value is 200 GiB.
NOTE: This parameter is only supported for tasks hosted on AWS Fargate using platform version 1.4.0 or later.
116 117 118 |
# File 'ecs/fargate_task_definition_props.rb', line 116 def ephemeral_storage_gib @ephemeral_storage_gib end |
#execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - An execution role will be automatically created if you use ECR images in your task definition.
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
The role will be used to retrieve container images from ECR and create CloudWatch log groups.
56 57 58 |
# File 'ecs/fargate_task_definition_props.rb', line 56 def execution_role @execution_role end |
#family ⇒ String? (readonly)
Default: - Automatically generated name.
The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.
63 64 65 |
# File 'ecs/fargate_task_definition_props.rb', line 63 def family @family end |
#memory_limit_mib ⇒ Numeric? (readonly)
Default: 512
The amount (in MiB) of memory used by the task.
For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:
512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU)
Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU)
Note: For windows platforms, this field is not enforced at runtime. However, it is still required as it is used to determine the instance type and size that tasks run on.
141 142 143 |
# File 'ecs/fargate_task_definition_props.rb', line 141 def memory_limit_mib @memory_limit_mib end |
#pid_mode ⇒ AWSCDK::ECS::PidMode? (readonly)
Default: - PidMode used by the task is not specified
The process namespace to use for the containers in the task.
Only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version 1.4.0 or later (Linux). Only the TASK option is supported for Linux-based Fargate containers. Not supported in Windows containers. If pidMode is specified for a Fargate task, then runtimePlatform.operatingSystemFamily must also be specified. For more information, see Task Definition Parameters.
153 154 155 |
# File 'ecs/fargate_task_definition_props.rb', line 153 def pid_mode @pid_mode end |
#proxy_configuration ⇒ AWSCDK::ECS::ProxyConfiguration? (readonly)
Default: - No proxy configuration.
The configuration details for the App Mesh proxy.
68 69 70 |
# File 'ecs/fargate_task_definition_props.rb', line 68 def proxy_configuration @proxy_configuration end |
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform? (readonly)
Default: - Undefined.
The operating system that your task definitions are running on.
A runtimePlatform is supported only for tasks using the Fargate launch type.
160 161 162 |
# File 'ecs/fargate_task_definition_props.rb', line 160 def runtime_platform @runtime_platform end |
#task_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A task role is automatically created for you.
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
73 74 75 |
# File 'ecs/fargate_task_definition_props.rb', line 73 def task_role @task_role end |
#volumes ⇒ Array<AWSCDK::ECS::Volume>? (readonly)
Default: - No volumes are passed to the Docker daemon on a container instance.
The list of volume definitions for the task.
For more information, see Task Definition Parameter Volumes.
81 82 83 |
# File 'ecs/fargate_task_definition_props.rb', line 81 def volumes @volumes end |
Class Method Details
.jsii_properties ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'ecs/fargate_task_definition_props.rb', line 162 def self.jsii_properties { :enable_fault_injection => "enableFaultInjection", :execution_role => "executionRole", :family => "family", :proxy_configuration => "proxyConfiguration", :task_role => "taskRole", :volumes => "volumes", :cpu => "cpu", :ephemeral_storage_gib => "ephemeralStorageGiB", :memory_limit_mib => "memoryLimitMiB", :pid_mode => "pidMode", :runtime_platform => "runtimePlatform", } end |
Instance Method Details
#to_jsii ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'ecs/fargate_task_definition_props.rb', line 178 def to_jsii result = {} result.merge!(super) result.merge!({ "enableFaultInjection" => @enable_fault_injection, "executionRole" => @execution_role, "family" => @family, "proxyConfiguration" => @proxy_configuration, "taskRole" => @task_role, "volumes" => @volumes, "cpu" => @cpu, "ephemeralStorageGiB" => @ephemeral_storage_gib, "memoryLimitMiB" => @memory_limit_mib, "pidMode" => @pid_mode, "runtimePlatform" => @runtime_platform, }) result.compact end |