Module: AWSCDK::Batch::IECSEC2ContainerDefinition

Includes:
IECSContainerDefinition
Included in:
ECSEC2ContainerDefinition
Defined in:
batch/iecsec2_container_definition.rb

Overview

A container orchestrated by ECS that uses EC2 resources.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'batch/iecsec2_container_definition.rb', line 198

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :cpu => { kind: :property, name: "cpu", is_optional: false },
    :execution_role => { kind: :property, name: "executionRole", is_optional: false },
    :image => { kind: :property, name: "image", is_optional: false },
    :memory => { kind: :property, name: "memory", is_optional: false },
    :volumes => { kind: :property, name: "volumes", is_optional: false },
    :command => { kind: :property, name: "command", is_optional: true },
    :enable_execute_command => { kind: :property, name: "enableExecuteCommand", is_optional: true },
    :environment => { kind: :property, name: "environment", is_optional: true },
    :job_role => { kind: :property, name: "jobRole", is_optional: true },
    :linux_parameters => { kind: :property, name: "linuxParameters", is_optional: true },
    :log_driver_config => { kind: :property, name: "logDriverConfig", is_optional: true },
    :readonly_root_filesystem => { kind: :property, name: "readonlyRootFilesystem", is_optional: true },
    :secrets => { kind: :property, name: "secrets", is_optional: true },
    :user => { kind: :property, name: "user", is_optional: true },
    :ulimits => { kind: :property, name: "ulimits", is_optional: false },
    :gpu => { kind: :property, name: "gpu", is_optional: true },
    :privileged => { kind: :property, name: "privileged", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :add_volume => { kind: :method, name: "addVolume", is_optional: false },
    :add_ulimit => { kind: :method, name: "addUlimit", is_optional: false },
  }
end

Instance Method Details

#add_ulimit(ulimit) ⇒ void

This method returns an undefined value.

Add a ulimit to this container.

Parameters:



192
193
194
195
196
# File 'batch/iecsec2_container_definition.rb', line 192

def add_ulimit(ulimit)
  ulimit = ulimit.is_a?(Hash) ? ::AWSCDK::Batch::Ulimit.new(**ulimit.transform_keys(&:to_sym)) : ulimit
  Jsii::Type.check_type(ulimit, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guVWxpbWl0In0=")), "ulimit")
  jsii_call_method("addUlimit", [ulimit])
end

#add_volume(volume) ⇒ void

This method returns an undefined value.

Add a Volume to this container.

Parameters:



183
184
185
186
# File 'batch/iecsec2_container_definition.rb', line 183

def add_volume(volume)
  Jsii::Type.check_type(volume, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWNzVm9sdW1lIn0=")), "volume")
  jsii_call_method("addVolume", [volume])
end

#commandArray<String>?

The command that's passed to the container.

Returns:

  • (Array<String>, nil)

See Also:



64
65
66
# File 'batch/iecsec2_container_definition.rb', line 64

def command()
  jsii_get_property("command")
end

#cpuNumeric

The number of vCPUs reserved for the container.

Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.

Returns:

  • (Numeric)


21
22
23
# File 'batch/iecsec2_container_definition.rb', line 21

def cpu()
  jsii_get_property("cpu")
end

#enable_execute_commandBoolean?

Note:

Default: undefined - AWS Batch default is false

Whether to enable ecs exec for this container.

Returns:

  • (Boolean, nil)


72
73
74
# File 'batch/iecsec2_container_definition.rb', line 72

def enable_execute_command()
  jsii_get_property("enableExecuteCommand")
end

#environmentHash{String => String}?

Note:

Default: - no environment variables

The environment variables to pass to a container.

Cannot start with AWS_BATCH. We don't recommend using plaintext environment variables for sensitive information, such as credential data.

Returns:

  • (Hash{String => String}, nil)


83
84
85
# File 'batch/iecsec2_container_definition.rb', line 83

def environment()
  jsii_get_property("environment")
end

#execution_roleAWSCDK::IAM::IRole

The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.



29
30
31
# File 'batch/iecsec2_container_definition.rb', line 29

def execution_role()
  jsii_get_property("executionRole")
end

#gpuNumeric?

Note:

Default: - no gpus

The number of physical GPUs to reserve for the container.

Make sure that the number of GPUs reserved for all containers in a job doesn't exceed the number of available GPUs on the compute resource that the job is launched on.

Returns:

  • (Numeric, nil)


153
154
155
# File 'batch/iecsec2_container_definition.rb', line 153

def gpu()
  jsii_get_property("gpu")
end

#imageAWSCDK::ECS::ContainerImage

The image that this container will run.



36
37
38
# File 'batch/iecsec2_container_definition.rb', line 36

def image()
  jsii_get_property("image")
end

#job_roleAWSCDK::IAM::IRole?

Note:

Default: - no jobRole

The role that the container can assume.



92
93
94
# File 'batch/iecsec2_container_definition.rb', line 92

def job_role()
  jsii_get_property("jobRole")
end

#linux_parametersAWSCDK::Batch::LinuxParameters?

Note:

Default: none

Linux-specific modifications that are applied to the container, such as details for device mappings.



100
101
102
# File 'batch/iecsec2_container_definition.rb', line 100

def linux_parameters()
  jsii_get_property("linuxParameters")
end

#log_driver_configAWSCDK::ECS::LogDriverConfig?

The configuration of the log driver.



107
108
109
# File 'batch/iecsec2_container_definition.rb', line 107

def log_driver_config()
  jsii_get_property("logDriverConfig")
end

#memoryAWSCDK::Size

The memory hard limit present to the container.

If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job.

Returns:



46
47
48
# File 'batch/iecsec2_container_definition.rb', line 46

def memory()
  jsii_get_property("memory")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


11
12
13
# File 'batch/iecsec2_container_definition.rb', line 11

def node()
  jsii_get_property("node")
end

#privilegedBoolean?

Note:

Default: false

When this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user).

Returns:

  • (Boolean, nil)


161
162
163
# File 'batch/iecsec2_container_definition.rb', line 161

def privileged()
  jsii_get_property("privileged")
end

#readonly_root_filesystemBoolean?

Note:

Default: false

Gives the container readonly access to its root filesystem.

Returns:

  • (Boolean, nil)


115
116
117
# File 'batch/iecsec2_container_definition.rb', line 115

def readonly_root_filesystem()
  jsii_get_property("readonlyRootFilesystem")
end

#secretsHash{String => AWSCDK::Batch::Secret}?

Note:

Default: - no secrets

A map from environment variable names to the secrets for the container.

Allows your job definitions to reference the secret by the environment variable name defined in this property.



127
128
129
# File 'batch/iecsec2_container_definition.rb', line 127

def secrets()
  jsii_get_property("secrets")
end

#ulimitsArray<AWSCDK::Batch::Ulimit>

Limits to set for the user this docker container will run as.

Returns:



142
143
144
# File 'batch/iecsec2_container_definition.rb', line 142

def ulimits()
  jsii_get_property("ulimits")
end

#userString?

Note:

Default: - no user

The user name to use inside the container.

Returns:

  • (String, nil)


135
136
137
# File 'batch/iecsec2_container_definition.rb', line 135

def user()
  jsii_get_property("user")
end

#volumesArray<AWSCDK::Batch::ECSVolume>

Note:

Default: - no volumes

The volumes to mount to this container.

Automatically added to the job definition.

Returns:



56
57
58
# File 'batch/iecsec2_container_definition.rb', line 56

def volumes()
  jsii_get_property("volumes")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



172
173
174
175
176
177
# File 'batch/iecsec2_container_definition.rb', line 172

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end