Class: AWSCDK::ECSPatterns::ScheduledFargateTaskImageOptions
- Inherits:
-
ScheduledTaskImageProps
- Object
- ScheduledTaskImageProps
- AWSCDK::ECSPatterns::ScheduledFargateTaskImageOptions
- Defined in:
- ecs_patterns/scheduled_fargate_task_image_options.rb
Overview
The properties for the ScheduledFargateTask using an image.
Instance Attribute Summary collapse
-
#circuit_breaker ⇒ AWSCDK::ECS::DeploymentCircuitBreaker?
readonly
Whether to enable the deployment circuit breaker.
-
#command ⇒ Array<String>?
readonly
The command that is passed to the container.
-
#container_name ⇒ String?
readonly
Optional name for the container added.
-
#cpu ⇒ Numeric?
readonly
The number of cpu units used by the task.
-
#environment ⇒ Hash{String => String}?
readonly
The environment variables to pass to the container.
-
#ephemeral_storage_gib ⇒ Numeric?
readonly
The amount (in GiB) of ephemeral storage to be allocated to the task.
-
#image ⇒ AWSCDK::ECS::ContainerImage
readonly
The image used to start a container.
-
#log_driver ⇒ AWSCDK::ECS::LogDriver?
readonly
The log driver to use.
-
#memory_limit_mib ⇒ Numeric?
readonly
The amount (in MiB) of memory used by the task.
-
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
readonly
The platform version on which to run your service.
-
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform?
readonly
The runtime platform of the task definition.
-
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}?
readonly
The secret to expose to the container as an environment variable.
-
#task_definition ⇒ AWSCDK::ECS::FargateTaskDefinition?
readonly
The task definition to use for tasks in the service.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil) ⇒ ScheduledFargateTaskImageOptions
constructor
A new instance of ScheduledFargateTaskImageOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil) ⇒ ScheduledFargateTaskImageOptions
Returns a new instance of ScheduledFargateTaskImageOptions.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 21 def initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil) @image = image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckltYWdlIn0=")), "image") @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil? @container_name = container_name Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil? @environment = environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil? @log_driver = log_driver Jsii::Type.check_type(@log_driver, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxvZ0RyaXZlciJ9")), "logDriver") unless @log_driver.nil? @secrets = secrets Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VjcmV0In0sImtpbmQiOiJtYXAifX0=")), "secrets") unless @secrets.nil? @circuit_breaker = circuit_breaker.is_a?(Hash) ? ::AWSCDK::ECS::DeploymentCircuitBreaker.new(**circuit_breaker.transform_keys(&:to_sym)) : circuit_breaker Jsii::Type.check_type(@circuit_breaker, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRlcGxveW1lbnRDaXJjdWl0QnJlYWtlciJ9")), "circuitBreaker") unless @circuit_breaker.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? @platform_version = platform_version Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVQbGF0Zm9ybVZlcnNpb24ifQ==")), "platformVersion") unless @platform_version.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? @task_definition = task_definition Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVUYXNrRGVmaW5pdGlvbiJ9")), "taskDefinition") unless @task_definition.nil? end |
Instance Attribute Details
#circuit_breaker ⇒ AWSCDK::ECS::DeploymentCircuitBreaker? (readonly)
Default: - disabled
Whether to enable the deployment circuit breaker.
If this property is defined, circuit breaker will be implicitly enabled.
91 92 93 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 91 def circuit_breaker @circuit_breaker end |
#command ⇒ Array<String>? (readonly)
Default: - CMD value built into container image.
The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.
63 64 65 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 63 def command @command end |
#container_name ⇒ String? (readonly)
Default: - ScheduledContainer
Optional name for the container added.
68 69 70 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 68 def container_name @container_name end |
#cpu ⇒ Numeric? (readonly)
Default: 256
The number of cpu units used by the task.
Valid values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
8192 (8 vCPU) - Available memory values: Between 16GB and 60GB in 4GB increments
16384 (16 vCPU) - Available memory values: Between 32GB and 120GB in 8GB increments
This default is set in the underlying FargateTaskDefinition construct.
114 115 116 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 114 def cpu @cpu end |
#environment ⇒ Hash{String => String}? (readonly)
Default: none
The environment variables to pass to the container.
73 74 75 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 73 def environment @environment end |
#ephemeral_storage_gib ⇒ Numeric? (readonly)
Default: Undefined, in which case, the task will receive 20GiB ephemeral storage.
The amount (in GiB) of ephemeral storage to be allocated to the task.
The minimum supported value is 21 GiB and the maximum supported value is 200 GiB.
Only supported in Fargate platform version 1.4.0 or later.
123 124 125 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 123 def ephemeral_storage_gib @ephemeral_storage_gib end |
#image ⇒ AWSCDK::ECS::ContainerImage (readonly)
Default: - none
The image used to start a container.
Image or taskDefinition must be specified, but not both.
56 57 58 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 56 def image @image end |
#log_driver ⇒ AWSCDK::ECS::LogDriver? (readonly)
Default: - AwsLogDriver if enableLogging is true
The log driver to use.
78 79 80 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 78 def log_driver @log_driver end |
#memory_limit_mib ⇒ Numeric? (readonly)
Default: 512
The amount (in MiB) of memory used by the task.
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)
This default is set in the underlying FargateTaskDefinition construct.
147 148 149 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 147 def memory_limit_mib @memory_limit_mib end |
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion? (readonly)
Default: Latest
The platform version on which to run your service.
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
156 157 158 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 156 def platform_version @platform_version end |
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform? (readonly)
Default: - If the property is undefined, operatingSystemFamily is LINUX and cpuArchitecture is X86_64
The runtime platform of the task definition.
161 162 163 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 161 def runtime_platform @runtime_platform end |
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}? (readonly)
Default: - No secret environment variables.
The secret to expose to the container as an environment variable.
83 84 85 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 83 def secrets @secrets end |
#task_definition ⇒ AWSCDK::ECS::FargateTaskDefinition? (readonly)
Default: - none
The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both.
[disable-awslint:ref-via-interface]
168 169 170 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 168 def task_definition @task_definition end |
Class Method Details
.jsii_properties ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 170 def self.jsii_properties { :image => "image", :command => "command", :container_name => "containerName", :environment => "environment", :log_driver => "logDriver", :secrets => "secrets", :circuit_breaker => "circuitBreaker", :cpu => "cpu", :ephemeral_storage_gib => "ephemeralStorageGiB", :memory_limit_mib => "memoryLimitMiB", :platform_version => "platformVersion", :runtime_platform => "runtimePlatform", :task_definition => "taskDefinition", } end |
Instance Method Details
#to_jsii ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'ecs_patterns/scheduled_fargate_task_image_options.rb', line 188 def to_jsii result = {} result.merge!(super) result.merge!({ "image" => @image, "command" => @command, "containerName" => @container_name, "environment" => @environment, "logDriver" => @log_driver, "secrets" => @secrets, "circuitBreaker" => @circuit_breaker, "cpu" => @cpu, "ephemeralStorageGiB" => @ephemeral_storage_gib, "memoryLimitMiB" => @memory_limit_mib, "platformVersion" => @platform_version, "runtimePlatform" => @runtime_platform, "taskDefinition" => @task_definition, }) result.compact end |