Class: AWSCDK::Batch::CfnJobDefinition::ECSTaskPropertiesProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/cfn_job_definition.rb

Overview

The properties for a task definition that describes the container and volume definitions of an Amazon ECS task.

You can specify which Docker images to use, the required resources, and other configurations related to launching the task definition through an Amazon ECS service or task.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(containers: nil, enable_execute_command: nil, ephemeral_storage: nil, execution_role_arn: nil, ipc_mode: nil, network_configuration: nil, pid_mode: nil, platform_version: nil, runtime_platform: nil, task_role_arn: nil, volumes: nil) ⇒ ECSTaskPropertiesProperty

Returns a new instance of ECSTaskPropertiesProperty.

Parameters:



1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
# File 'batch/cfn_job_definition.rb', line 1250

def initialize(containers: nil, enable_execute_command: nil, ephemeral_storage: nil, execution_role_arn: nil, ipc_mode: nil, network_configuration: nil, pid_mode: nil, platform_version: nil, runtime_platform: nil, task_role_arn: nil, volumes: nil)
  @containers = containers
  Jsii::Type.check_type(@containers, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guQ2ZuSm9iRGVmaW5pdGlvbi5UYXNrQ29udGFpbmVyUHJvcGVydGllc1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "containers") unless @containers.nil?
  @enable_execute_command = enable_execute_command
  Jsii::Type.check_type(@enable_execute_command, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableExecuteCommand") unless @enable_execute_command.nil?
  @ephemeral_storage = ephemeral_storage.is_a?(Hash) ? ::AWSCDK::Batch::CfnJobDefinition::EphemeralStorageProperty.new(**ephemeral_storage.transform_keys(&:to_sym)) : ephemeral_storage
  Jsii::Type.check_type(@ephemeral_storage, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5DZm5Kb2JEZWZpbml0aW9uLkVwaGVtZXJhbFN0b3JhZ2VQcm9wZXJ0eSJ9XX19")), "ephemeralStorage") unless @ephemeral_storage.nil?
  @execution_role_arn = execution_role_arn
  Jsii::Type.check_type(@execution_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "executionRoleArn") unless @execution_role_arn.nil?
  @ipc_mode = ipc_mode
  Jsii::Type.check_type(@ipc_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipcMode") unless @ipc_mode.nil?
  @network_configuration = network_configuration.is_a?(Hash) ? ::AWSCDK::Batch::CfnJobDefinition::NetworkConfigurationProperty.new(**network_configuration.transform_keys(&:to_sym)) : network_configuration
  Jsii::Type.check_type(@network_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5DZm5Kb2JEZWZpbml0aW9uLk5ldHdvcmtDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "networkConfiguration") unless @network_configuration.nil?
  @pid_mode = pid_mode
  Jsii::Type.check_type(@pid_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pidMode") unless @pid_mode.nil?
  @platform_version = platform_version
  Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platformVersion") unless @platform_version.nil?
  @runtime_platform = runtime_platform.is_a?(Hash) ? ::AWSCDK::Batch::CfnJobDefinition::RuntimePlatformProperty.new(**runtime_platform.transform_keys(&:to_sym)) : runtime_platform
  Jsii::Type.check_type(@runtime_platform, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5DZm5Kb2JEZWZpbml0aW9uLlJ1bnRpbWVQbGF0Zm9ybVByb3BlcnR5In1dfX0=")), "runtimePlatform") unless @runtime_platform.nil?
  @task_role_arn = task_role_arn
  Jsii::Type.check_type(@task_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "taskRoleArn") unless @task_role_arn.nil?
  @volumes = volumes
  Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guQ2ZuSm9iRGVmaW5pdGlvbi5Wb2x1bWVzUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "volumes") unless @volumes.nil?
end

Instance Attribute Details

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

This object is a list of containers.



1279
1280
1281
# File 'batch/cfn_job_definition.rb', line 1279

def containers
  @containers
end

#enable_execute_commandBoolean, ... (readonly)

Determines whether execute command functionality is turned on for this task.

If true , execute command functionality is turned on all the containers in the task.



1286
1287
1288
# File 'batch/cfn_job_definition.rb', line 1286

def enable_execute_command
  @enable_execute_command
end

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

The amount of ephemeral storage to allocate for the task.

This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .



1293
1294
1295
# File 'batch/cfn_job_definition.rb', line 1293

def ephemeral_storage
  @ephemeral_storage
end

#execution_role_arnString? (readonly)

The Amazon Resource Name (ARN) of the execution role that AWS Batch can assume.

For jobs that run on Fargate resources, you must provide an execution role. For more information, see AWS Batch execution IAM role in the AWS Batch User Guide .



1300
1301
1302
# File 'batch/cfn_job_definition.rb', line 1300

def execution_role_arn
  @execution_role_arn
end

#ipc_modeString? (readonly)

The IPC resource namespace to use for the containers in the task.

The valid values are host , task , or none .

If host is specified, all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance.

If task is specified, all containers within the specified task share the same IPC resources.

If none is specified, the IPC resources within the containers of a task are private, and are not shared with other containers in a task or on the container instance.

If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more information, see IPC settings in the Docker run reference.



1315
1316
1317
# File 'batch/cfn_job_definition.rb', line 1315

def ipc_mode
  @ipc_mode
end

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

The network configuration for jobs that are running on Fargate resources.

Jobs that are running on Amazon EC2 resources must not specify this parameter.



1322
1323
1324
# File 'batch/cfn_job_definition.rb', line 1322

def network_configuration
  @network_configuration
end

#pid_modeString? (readonly)

The process namespace to use for the containers in the task.

The valid values are host or task . For example, monitoring sidecars might need pid_mode to access information about other containers running in the same task.

If host is specified, all containers within the tasks that specified the host PID mode on the same container instance share the process namespace with the host Amazon EC2 instance.

If task is specified, all containers within the specified task share the same process namespace.

If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run reference.



1335
1336
1337
# File 'batch/cfn_job_definition.rb', line 1335

def pid_mode
  @pid_mode
end

#platform_versionString? (readonly)

The Fargate platform version where the jobs are running.

A platform version is specified only for jobs that are running on Fargate resources. If one isn't specified, the LATEST platform version is used by default. This uses a recent, approved version of the Fargate platform for compute resources. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .



1342
1343
1344
# File 'batch/cfn_job_definition.rb', line 1342

def platform_version
  @platform_version
end

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

An object that represents the compute environment architecture for AWS Batch jobs on Fargate.



1347
1348
1349
# File 'batch/cfn_job_definition.rb', line 1347

def runtime_platform
  @runtime_platform
end

#task_role_arnString? (readonly)

The Amazon Resource Name (ARN) that's associated with the Amazon ECS task.

This is object is comparable to ContainerProperties:jobRoleArn .



1354
1355
1356
# File 'batch/cfn_job_definition.rb', line 1354

def task_role_arn
  @task_role_arn
end

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

A list of volumes that are associated with the job.



1359
1360
1361
# File 'batch/cfn_job_definition.rb', line 1359

def volumes
  @volumes
end

Class Method Details

.jsii_propertiesObject



1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'batch/cfn_job_definition.rb', line 1361

def self.jsii_properties
  {
    :containers => "containers",
    :enable_execute_command => "enableExecuteCommand",
    :ephemeral_storage => "ephemeralStorage",
    :execution_role_arn => "executionRoleArn",
    :ipc_mode => "ipcMode",
    :network_configuration => "networkConfiguration",
    :pid_mode => "pidMode",
    :platform_version => "platformVersion",
    :runtime_platform => "runtimePlatform",
    :task_role_arn => "taskRoleArn",
    :volumes => "volumes",
  }
end

Instance Method Details

#to_jsiiObject



1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
# File 'batch/cfn_job_definition.rb', line 1377

def to_jsii
  result = {}
  result.merge!({
    "containers" => @containers,
    "enableExecuteCommand" => @enable_execute_command,
    "ephemeralStorage" => @ephemeral_storage,
    "executionRoleArn" => @execution_role_arn,
    "ipcMode" => @ipc_mode,
    "networkConfiguration" => @network_configuration,
    "pidMode" => @pid_mode,
    "platformVersion" => @platform_version,
    "runtimePlatform" => @runtime_platform,
    "taskRoleArn" => @task_role_arn,
    "volumes" => @volumes,
  })
  result.compact
end