Class: AWSCDK::StepFunctionsTasks::ContainerOverride

Inherits:
Jsii::Struct
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_definition:, command: nil, cpu: nil, environment: nil, memory_limit: nil, memory_reservation: nil) ⇒ ContainerOverride

Returns a new instance of ContainerOverride.

Parameters:

  • container_definition (AWSCDK::ECS::ContainerDefinition)

    Name of the container inside the task definition.

  • command (Array<String>, nil) (defaults to: nil)

    Command to run inside the container.

  • cpu (Numeric, nil) (defaults to: nil)

    The number of cpu units reserved for the container.

  • environment (Array<AWSCDK::StepFunctionsTasks::TaskEnvironmentVariable>, nil) (defaults to: nil)

    The environment variables to send to the container.

  • memory_limit (Numeric, nil) (defaults to: nil)

    The hard limit (in MiB) of memory to present to the container.

  • memory_reservation (Numeric, nil) (defaults to: nil)

    The soft limit (in MiB) of memory to reserve for the container.



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

#commandArray<String>? (readonly)

Note:

Default: - Default command from the Docker image or the task definition

Command to run inside the container.

Returns:

  • (Array<String>, nil)


36
37
38
# File 'step_functions_tasks/container_override.rb', line 36

def command
  @command
end

#container_definitionAWSCDK::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

#cpuNumeric? (readonly)

Note:

Default: - The default value from the task definition.

The number of cpu units reserved for the container.

Returns:

  • (Numeric, nil)


41
42
43
# File 'step_functions_tasks/container_override.rb', line 41

def cpu
  @cpu
end

#environmentArray<AWSCDK::StepFunctionsTasks::TaskEnvironmentVariable>? (readonly)

Note:

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_limitNumeric? (readonly)

Note:

Default: - The default value from the task definition.

The hard limit (in MiB) of memory to present to the container.

Returns:

  • (Numeric, nil)


54
55
56
# File 'step_functions_tasks/container_override.rb', line 54

def memory_limit
  @memory_limit
end

#memory_reservationNumeric? (readonly)

Note:

Default: - The default value from the task definition.

The soft limit (in MiB) of memory to reserve for the container.

Returns:

  • (Numeric, nil)


59
60
61
# File 'step_functions_tasks/container_override.rb', line 59

def memory_reservation
  @memory_reservation
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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