Class: AWSCDK::StepFunctionsTasks::ContainerOverride
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::StepFunctionsTasks::ContainerOverride
- Defined in:
- step_functions_tasks/container_override.rb
Overview
A list of container overrides that specify the name of a container and the overrides it should receive.
Instance Attribute Summary collapse
-
#command ⇒ Array<String>?
readonly
Command to run inside the container.
-
#container_definition ⇒ AWSCDK::ECS::ContainerDefinition
readonly
Name of the container inside the task definition.
-
#cpu ⇒ Numeric?
readonly
The number of cpu units reserved for the container.
-
#environment ⇒ Array<AWSCDK::StepFunctionsTasks::TaskEnvironmentVariable>?
readonly
The environment variables to send to the container.
-
#memory_limit ⇒ Numeric?
readonly
The hard limit (in MiB) of memory to present to the container.
-
#memory_reservation ⇒ Numeric?
readonly
The soft limit (in MiB) of memory to reserve for the container.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(container_definition:, command: nil, cpu: nil, environment: nil, memory_limit: nil, memory_reservation: nil) ⇒ ContainerOverride
constructor
A new instance of ContainerOverride.
- #to_jsii ⇒ Object
Constructor Details
#initialize(container_definition:, command: nil, cpu: nil, environment: nil, memory_limit: nil, memory_reservation: nil) ⇒ ContainerOverride
Returns a new instance of ContainerOverride.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'step_functions_tasks/container_override.rb', line 13 def initialize(container_definition:, command: nil, cpu: nil, environment: nil, memory_limit: nil, memory_reservation: nil) @container_definition = container_definition Jsii::Type.check_type(@container_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckRlZmluaXRpb24ifQ==")), "containerDefinition") @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil? @cpu = cpu Jsii::Type.check_type(@cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpu") unless @cpu.nil? @environment = environment.is_a?(Array) ? environment.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::StepFunctionsTasks::TaskEnvironmentVariable.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zdGVwZnVuY3Rpb25zX3Rhc2tzLlRhc2tFbnZpcm9ubWVudFZhcmlhYmxlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "environment") unless @environment.nil? @memory_limit = memory_limit Jsii::Type.check_type(@memory_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryLimit") unless @memory_limit.nil? @memory_reservation = memory_reservation Jsii::Type.check_type(@memory_reservation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryReservation") unless @memory_reservation.nil? end |
Instance Attribute Details
#command ⇒ Array<String>? (readonly)
Default: - Default command from the Docker image or the task definition
Command to run inside the container.
36 37 38 |
# File 'step_functions_tasks/container_override.rb', line 36 def command @command end |
#container_definition ⇒ AWSCDK::ECS::ContainerDefinition (readonly)
Name of the container inside the task definition.
31 32 33 |
# File 'step_functions_tasks/container_override.rb', line 31 def container_definition @container_definition end |
#cpu ⇒ Numeric? (readonly)
Default: - The default value from the task definition.
The number of cpu units reserved for the container.
41 42 43 |
# File 'step_functions_tasks/container_override.rb', line 41 def cpu @cpu end |
#environment ⇒ Array<AWSCDK::StepFunctionsTasks::TaskEnvironmentVariable>? (readonly)
Default: - The existing environment variables from the Docker image or the task definition
The environment variables to send to the container.
You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the task definition.
49 50 51 |
# File 'step_functions_tasks/container_override.rb', line 49 def environment @environment end |
#memory_limit ⇒ Numeric? (readonly)
Default: - The default value from the task definition.
The hard limit (in MiB) of memory to present to the container.
54 55 56 |
# File 'step_functions_tasks/container_override.rb', line 54 def memory_limit @memory_limit end |
#memory_reservation ⇒ Numeric? (readonly)
Default: - The default value from the task definition.
The soft limit (in MiB) of memory to reserve for the container.
59 60 61 |
# File 'step_functions_tasks/container_override.rb', line 59 def memory_reservation @memory_reservation end |
Class Method Details
.jsii_properties ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'step_functions_tasks/container_override.rb', line 61 def self.jsii_properties { :container_definition => "containerDefinition", :command => "command", :cpu => "cpu", :environment => "environment", :memory_limit => "memoryLimit", :memory_reservation => "memoryReservation", } end |
Instance Method Details
#to_jsii ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'step_functions_tasks/container_override.rb', line 72 def to_jsii result = {} result.merge!({ "containerDefinition" => @container_definition, "command" => @command, "cpu" => @cpu, "environment" => @environment, "memoryLimit" => @memory_limit, "memoryReservation" => @memory_reservation, }) result.compact end |