Class: AWSCDK::Pipes::CfnPipe::ECSContainerOverrideProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pipes/cfn_pipe.rb

Overview

The overrides that are sent to a container.

An empty container override can be passed in. An example of an empty container override is {"containerOverrides": [ ] } . If a non-empty container override is specified, the name parameter must be included.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command: nil, cpu: nil, environment: nil, environment_files: nil, memory: nil, memory_reservation: nil, name: nil, resource_requirements: nil) ⇒ ECSContainerOverrideProperty

Returns a new instance of ECSContainerOverrideProperty.

Parameters:

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

    The command to send to the container that overrides the default command from the Docker image or the task definition.

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

    The number of cpu units reserved for the container, instead of the default value from the task definition.

  • environment (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Pipes::CfnPipe::ECSEnvironmentVariableProperty>, nil) (defaults to: nil)

    The environment variables to send to the container.

  • environment_files (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Pipes::CfnPipe::ECSEnvironmentFileProperty>, nil) (defaults to: nil)

    A list of files containing the environment variables to pass to a container, instead of the value from the container definition.

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

    The hard limit (in MiB) of memory to present to the container, instead of the default value from the task definition.

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

    The soft limit (in MiB) of memory to reserve for the container, instead of the default value from the task definition.

  • name (String, nil) (defaults to: nil)

    The name of the container that receives the override.

  • resource_requirements (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Pipes::CfnPipe::ECSResourceRequirementProperty>, nil) (defaults to: nil)

    The type and amount of a resource to assign to a container, instead of the default value from the task definition.



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
# File 'pipes/cfn_pipe.rb', line 1292

def initialize(command: nil, cpu: nil, environment: nil, environment_files: nil, memory: nil, memory_reservation: nil, name: nil, resource_requirements: nil)
  @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
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcGlwZXMuQ2ZuUGlwZS5FY3NFbnZpcm9ubWVudFZhcmlhYmxlUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "environment") unless @environment.nil?
  @environment_files = environment_files
  Jsii::Type.check_type(@environment_files, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcGlwZXMuQ2ZuUGlwZS5FY3NFbnZpcm9ubWVudEZpbGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "environmentFiles") unless @environment_files.nil?
  @memory = memory
  Jsii::Type.check_type(@memory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memory") unless @memory.nil?
  @memory_reservation = memory_reservation
  Jsii::Type.check_type(@memory_reservation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryReservation") unless @memory_reservation.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @resource_requirements = resource_requirements
  Jsii::Type.check_type(@resource_requirements, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcGlwZXMuQ2ZuUGlwZS5FY3NSZXNvdXJjZVJlcXVpcmVtZW50UHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "resourceRequirements") unless @resource_requirements.nil?
end

Instance Attribute Details

#commandArray<String>? (readonly)

The command to send to the container that overrides the default command from the Docker image or the task definition.

You must also specify a container name.



1317
1318
1319
# File 'pipes/cfn_pipe.rb', line 1317

def command
  @command
end

#cpuNumeric? (readonly)

The number of cpu units reserved for the container, instead of the default value from the task definition.

You must also specify a container name.



1324
1325
1326
# File 'pipes/cfn_pipe.rb', line 1324

def cpu
  @cpu
end

#environmentAWSCDK::IResolvable, ... (readonly)

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. You must also specify a container name.



1331
1332
1333
# File 'pipes/cfn_pipe.rb', line 1331

def environment
  @environment
end

#environment_filesAWSCDK::IResolvable, ... (readonly)

A list of files containing the environment variables to pass to a container, instead of the value from the container definition.



1336
1337
1338
# File 'pipes/cfn_pipe.rb', line 1336

def environment_files
  @environment_files
end

#memoryNumeric? (readonly)

The hard limit (in MiB) of memory to present to the container, instead of the default value from the task definition.

If your container attempts to exceed the memory specified here, the container is killed. You must also specify a container name.



1343
1344
1345
# File 'pipes/cfn_pipe.rb', line 1343

def memory
  @memory
end

#memory_reservationNumeric? (readonly)

The soft limit (in MiB) of memory to reserve for the container, instead of the default value from the task definition.

You must also specify a container name.



1350
1351
1352
# File 'pipes/cfn_pipe.rb', line 1350

def memory_reservation
  @memory_reservation
end

#nameString? (readonly)

The name of the container that receives the override.

This parameter is required if any override is specified.



1357
1358
1359
# File 'pipes/cfn_pipe.rb', line 1357

def name
  @name
end

#resource_requirementsAWSCDK::IResolvable, ... (readonly)

The type and amount of a resource to assign to a container, instead of the default value from the task definition.

The only supported resource is a GPU.



1364
1365
1366
# File 'pipes/cfn_pipe.rb', line 1364

def resource_requirements
  @resource_requirements
end

Class Method Details

.jsii_propertiesObject



1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
# File 'pipes/cfn_pipe.rb', line 1366

def self.jsii_properties
  {
    :command => "command",
    :cpu => "cpu",
    :environment => "environment",
    :environment_files => "environmentFiles",
    :memory => "memory",
    :memory_reservation => "memoryReservation",
    :name => "name",
    :resource_requirements => "resourceRequirements",
  }
end

Instance Method Details

#to_jsiiObject



1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
# File 'pipes/cfn_pipe.rb', line 1379

def to_jsii
  result = {}
  result.merge!({
    "command" => @command,
    "cpu" => @cpu,
    "environment" => @environment,
    "environmentFiles" => @environment_files,
    "memory" => @memory,
    "memoryReservation" => @memory_reservation,
    "name" => @name,
    "resourceRequirements" => @resource_requirements,
  })
  result.compact
end