Class: AWSCDK::ECS::ContainerDefinitionOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/container_definition_options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image:, command: nil, container_name: nil, cpu: nil, credential_specs: nil, disable_networking: nil, dns_search_domains: nil, dns_servers: nil, docker_labels: nil, docker_security_options: nil, enable_restart_policy: nil, entry_point: nil, environment: nil, environment_files: nil, essential: nil, extra_hosts: nil, gpu_count: nil, health_check: nil, hostname: nil, inference_accelerator_resources: nil, interactive: nil, linux_parameters: nil, logging: nil, memory_limit_mib: nil, memory_reservation_mib: nil, port_mappings: nil, privileged: nil, pseudo_terminal: nil, readonly_root_filesystem: nil, restart_attempt_period: nil, restart_ignored_exit_codes: nil, secrets: nil, start_timeout: nil, stop_timeout: nil, system_controls: nil, ulimits: nil, user: nil, version_consistency: nil, working_directory: nil) ⇒ ContainerDefinitionOptions

Returns a new instance of ContainerDefinitionOptions.

Parameters:

  • image (AWSCDK::ECS::ContainerImage)

    The image used to start a container.

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

    The command that is passed to the container.

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

    The name of the container.

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

    The minimum number of CPU units to reserve for the container.

  • credential_specs (Array<AWSCDK::ECS::CredentialSpec>, nil) (defaults to: nil)

    A list of ARNs in SSM or Amazon S3 to a credential spec (CredSpec) file that configures the container for Active Directory authentication.

  • disable_networking (Boolean, nil) (defaults to: nil)

    Specifies whether networking is disabled within the container.

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

    A list of DNS search domains that are presented to the container.

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

    A list of DNS servers that are presented to the container.

  • docker_labels (Hash{String => String}, nil) (defaults to: nil)

    A key/value map of labels to add to the container.

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

    A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.

  • enable_restart_policy (Boolean, nil) (defaults to: nil)

    Enable a restart policy for a container.

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

    The ENTRYPOINT value to pass to the container.

  • environment (Hash{String => String}, nil) (defaults to: nil)

    The environment variables to pass to the container.

  • environment_files (Array<AWSCDK::ECS::EnvironmentFile>, nil) (defaults to: nil)

    The environment files to pass to the container.

  • essential (Boolean, nil) (defaults to: nil)

    Specifies whether the container is marked essential.

  • extra_hosts (Hash{String => String}, nil) (defaults to: nil)

    A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.

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

    The number of GPUs assigned to the container.

  • health_check (AWSCDK::ECS::HealthCheck, nil) (defaults to: nil)

    The health check command and associated configuration parameters for the container.

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

    The hostname to use for your container.

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

    The inference accelerators referenced by the container.

  • interactive (Boolean, nil) (defaults to: nil)

    When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.

  • linux_parameters (AWSCDK::ECS::LinuxParameters, nil) (defaults to: nil)

    Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.

  • logging (AWSCDK::ECS::LogDriver, nil) (defaults to: nil)

    The log configuration specification for the container.

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

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

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

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

  • port_mappings (Array<AWSCDK::ECS::PortMapping>, nil) (defaults to: nil)

    The port mappings to add to the container definition.

  • privileged (Boolean, nil) (defaults to: nil)

    Specifies whether the container is marked as privileged.

  • pseudo_terminal (Boolean, nil) (defaults to: nil)

    When this parameter is true, a TTY is allocated.

  • readonly_root_filesystem (Boolean, nil) (defaults to: nil)

    When this parameter is true, the container is given read-only access to its root file system.

  • restart_attempt_period (AWSCDK::Duration, nil) (defaults to: nil)

    A period of time that the container must run for before a restart can be attempted.

  • restart_ignored_exit_codes (Array<Numeric>, nil) (defaults to: nil)

    A list of exit codes that Amazon ECS will ignore and not attempt a restart on.

  • secrets (Hash{String => AWSCDK::ECS::Secret}, nil) (defaults to: nil)

    The secret environment variables to pass to the container.

  • start_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Time duration (in seconds) to wait before giving up on resolving dependencies for a container.

  • stop_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.

  • system_controls (Array<AWSCDK::ECS::SystemControl>, nil) (defaults to: nil)

    A list of namespaced kernel parameters to set in the container.

  • ulimits (Array<AWSCDK::ECS::Ulimit>, nil) (defaults to: nil)

    An array of ulimits to set in the container.

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

    The user to use inside the container.

  • version_consistency (AWSCDK::ECS::VersionConsistency, nil) (defaults to: nil)

    Specifies whether Amazon ECS will resolve the container image tag provided in the container definition to an image digest.

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

    The working directory in which to run commands inside the container.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'ecs/container_definition_options.rb', line 45

def initialize(image:, command: nil, container_name: nil, cpu: nil, credential_specs: nil, disable_networking: nil, dns_search_domains: nil, dns_servers: nil, docker_labels: nil, docker_security_options: nil, enable_restart_policy: nil, entry_point: nil, environment: nil, environment_files: nil, essential: nil, extra_hosts: nil, gpu_count: nil, health_check: nil, hostname: nil, inference_accelerator_resources: nil, interactive: nil, linux_parameters: nil, logging: nil, memory_limit_mib: nil, memory_reservation_mib: nil, port_mappings: nil, privileged: nil, pseudo_terminal: nil, readonly_root_filesystem: nil, restart_attempt_period: nil, restart_ignored_exit_codes: nil, secrets: nil, start_timeout: nil, stop_timeout: nil, system_controls: nil, ulimits: nil, user: nil, version_consistency: nil, working_directory: nil)
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckltYWdlIn0=")), "image")
  @command = command
  Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil?
  @container_name = container_name
  Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil?
  @cpu = cpu
  Jsii::Type.check_type(@cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpu") unless @cpu.nil?
  @credential_specs = credential_specs
  Jsii::Type.check_type(@credential_specs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ3JlZGVudGlhbFNwZWMifSwia2luZCI6ImFycmF5In19")), "credentialSpecs") unless @credential_specs.nil?
  @disable_networking = disable_networking
  Jsii::Type.check_type(@disable_networking, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableNetworking") unless @disable_networking.nil?
  @dns_search_domains = dns_search_domains
  Jsii::Type.check_type(@dns_search_domains, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dnsSearchDomains") unless @dns_search_domains.nil?
  @dns_servers = dns_servers
  Jsii::Type.check_type(@dns_servers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dnsServers") unless @dns_servers.nil?
  @docker_labels = docker_labels
  Jsii::Type.check_type(@docker_labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dockerLabels") unless @docker_labels.nil?
  @docker_security_options = docker_security_options
  Jsii::Type.check_type(@docker_security_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dockerSecurityOptions") unless @docker_security_options.nil?
  @enable_restart_policy = enable_restart_policy
  Jsii::Type.check_type(@enable_restart_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableRestartPolicy") unless @enable_restart_policy.nil?
  @entry_point = entry_point
  Jsii::Type.check_type(@entry_point, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "entryPoint") unless @entry_point.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil?
  @environment_files = environment_files
  Jsii::Type.check_type(@environment_files, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuRW52aXJvbm1lbnRGaWxlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "environmentFiles") unless @environment_files.nil?
  @essential = essential
  Jsii::Type.check_type(@essential, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "essential") unless @essential.nil?
  @extra_hosts = extra_hosts
  Jsii::Type.check_type(@extra_hosts, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "extraHosts") unless @extra_hosts.nil?
  @gpu_count = gpu_count
  Jsii::Type.check_type(@gpu_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "gpuCount") unless @gpu_count.nil?
  @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ECS::HealthCheck.new(**health_check.transform_keys(&:to_sym)) : health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkhlYWx0aENoZWNrIn0=")), "healthCheck") unless @health_check.nil?
  @hostname = hostname
  Jsii::Type.check_type(@hostname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostname") unless @hostname.nil?
  @inference_accelerator_resources = inference_accelerator_resources
  Jsii::Type.check_type(@inference_accelerator_resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "inferenceAcceleratorResources") unless @inference_accelerator_resources.nil?
  @interactive = interactive
  Jsii::Type.check_type(@interactive, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "interactive") unless @interactive.nil?
  @linux_parameters = linux_parameters
  Jsii::Type.check_type(@linux_parameters, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxpbnV4UGFyYW1ldGVycyJ9")), "linuxParameters") unless @linux_parameters.nil?
  @logging = logging
  Jsii::Type.check_type(@logging, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxvZ0RyaXZlciJ9")), "logging") unless @logging.nil?
  @memory_limit_mib = memory_limit_mib
  Jsii::Type.check_type(@memory_limit_mib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryLimitMiB") unless @memory_limit_mib.nil?
  @memory_reservation_mib = memory_reservation_mib
  Jsii::Type.check_type(@memory_reservation_mib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryReservationMiB") unless @memory_reservation_mib.nil?
  @port_mappings = port_mappings.is_a?(Array) ? port_mappings.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::PortMapping.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : port_mappings
  Jsii::Type.check_type(@port_mappings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuUG9ydE1hcHBpbmcifSwia2luZCI6ImFycmF5In19")), "portMappings") unless @port_mappings.nil?
  @privileged = privileged
  Jsii::Type.check_type(@privileged, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "privileged") unless @privileged.nil?
  @pseudo_terminal = pseudo_terminal
  Jsii::Type.check_type(@pseudo_terminal, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "pseudoTerminal") unless @pseudo_terminal.nil?
  @readonly_root_filesystem = readonly_root_filesystem
  Jsii::Type.check_type(@readonly_root_filesystem, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "readonlyRootFilesystem") unless @readonly_root_filesystem.nil?
  @restart_attempt_period = restart_attempt_period
  Jsii::Type.check_type(@restart_attempt_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "restartAttemptPeriod") unless @restart_attempt_period.nil?
  @restart_ignored_exit_codes = restart_ignored_exit_codes
  Jsii::Type.check_type(@restart_ignored_exit_codes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6Im51bWJlciJ9LCJraW5kIjoiYXJyYXkifX0=")), "restartIgnoredExitCodes") unless @restart_ignored_exit_codes.nil?
  @secrets = secrets
  Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VjcmV0In0sImtpbmQiOiJtYXAifX0=")), "secrets") unless @secrets.nil?
  @start_timeout = start_timeout
  Jsii::Type.check_type(@start_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "startTimeout") unless @start_timeout.nil?
  @stop_timeout = stop_timeout
  Jsii::Type.check_type(@stop_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "stopTimeout") unless @stop_timeout.nil?
  @system_controls = system_controls.is_a?(Array) ? system_controls.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::SystemControl.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : system_controls
  Jsii::Type.check_type(@system_controls, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU3lzdGVtQ29udHJvbCJ9LCJraW5kIjoiYXJyYXkifX0=")), "systemControls") unless @system_controls.nil?
  @ulimits = ulimits.is_a?(Array) ? ulimits.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Ulimit.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : ulimits
  Jsii::Type.check_type(@ulimits, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuVWxpbWl0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "ulimits") unless @ulimits.nil?
  @user = user
  Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "user") unless @user.nil?
  @version_consistency = version_consistency
  Jsii::Type.check_type(@version_consistency, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlZlcnNpb25Db25zaXN0ZW5jeSJ9")), "versionConsistency") unless @version_consistency.nil?
  @working_directory = working_directory
  Jsii::Type.check_type(@working_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "workingDirectory") unless @working_directory.nil?
end

Instance Attribute Details

#commandArray<String>? (readonly)

Note:

Default: - CMD value built into container image.

The command that is passed to the container.

If you provide a shell command as a single string, you have to quote command-line arguments.

Returns:

  • (Array<String>, nil)


141
142
143
# File 'ecs/container_definition_options.rb', line 141

def command
  @command
end

#container_nameString? (readonly)

Note:

Default: - id of node associated with ContainerDefinition.

The name of the container.

Returns:

  • (String, nil)


146
147
148
# File 'ecs/container_definition_options.rb', line 146

def container_name
  @container_name
end

#cpuNumeric? (readonly)

Note:

Default: - No minimum CPU units reserved.

The minimum number of CPU units to reserve for the container.

Returns:

  • (Numeric, nil)


151
152
153
# File 'ecs/container_definition_options.rb', line 151

def cpu
  @cpu
end

#credential_specsArray<AWSCDK::ECS::CredentialSpec>? (readonly)

Note:

Default: - No credential specs.

A list of ARNs in SSM or Amazon S3 to a credential spec (CredSpec) file that configures the container for Active Directory authentication.

We recommend that you use this parameter instead of the docker_security_options.

Currently, only one credential spec is allowed per container definition.

Returns:



160
161
162
# File 'ecs/container_definition_options.rb', line 160

def credential_specs
  @credential_specs
end

#disable_networkingBoolean? (readonly)

Note:

Default: false

Specifies whether networking is disabled within the container.

When this parameter is true, networking is disabled within the container.

Returns:

  • (Boolean, nil)


167
168
169
# File 'ecs/container_definition_options.rb', line 167

def disable_networking
  @disable_networking
end

#dns_search_domainsArray<String>? (readonly)

Note:

Default: - No search domains.

A list of DNS search domains that are presented to the container.

Returns:

  • (Array<String>, nil)


172
173
174
# File 'ecs/container_definition_options.rb', line 172

def dns_search_domains
  @dns_search_domains
end

#dns_serversArray<String>? (readonly)

Note:

Default: - Default DNS servers.

A list of DNS servers that are presented to the container.

Returns:

  • (Array<String>, nil)


177
178
179
# File 'ecs/container_definition_options.rb', line 177

def dns_servers
  @dns_servers
end

#docker_labelsHash{String => String}? (readonly)

Note:

Default: - No labels.

A key/value map of labels to add to the container.

Returns:

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


182
183
184
# File 'ecs/container_definition_options.rb', line 182

def docker_labels
  @docker_labels
end

#docker_security_optionsArray<String>? (readonly)

Note:

Default: - No security labels.

A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.

Returns:

  • (Array<String>, nil)


187
188
189
# File 'ecs/container_definition_options.rb', line 187

def docker_security_options
  @docker_security_options
end

#enable_restart_policyBoolean? (readonly)

Note:

Default: - false unless restartIgnoredExitCodes or restartAttemptPeriod is set.

Enable a restart policy for a container.

When you set up a restart policy, Amazon ECS can restart the container without needing to replace the task.



195
196
197
# File 'ecs/container_definition_options.rb', line 195

def enable_restart_policy
  @enable_restart_policy
end

#entry_pointArray<String>? (readonly)

Note:

Default: - Entry point configured in container.

The ENTRYPOINT value to pass to the container.

Returns:

  • (Array<String>, nil)

See Also:



201
202
203
# File 'ecs/container_definition_options.rb', line 201

def entry_point
  @entry_point
end

#environmentHash{String => String}? (readonly)

Note:

Default: - No environment variables.

The environment variables to pass to the container.

Returns:

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


206
207
208
# File 'ecs/container_definition_options.rb', line 206

def environment
  @environment
end

#environment_filesArray<AWSCDK::ECS::EnvironmentFile>? (readonly)

Note:

Default: - No environment files.

The environment files to pass to the container.



212
213
214
# File 'ecs/container_definition_options.rb', line 212

def environment_files
  @environment_files
end

#essentialBoolean? (readonly)

Note:

Default: true

Specifies whether the container is marked essential.

If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container.

If this parameter is omitted, a container is assumed to be essential.

Returns:

  • (Boolean, nil)


224
225
226
# File 'ecs/container_definition_options.rb', line 224

def essential
  @essential
end

#extra_hostsHash{String => String}? (readonly)

Note:

Default: - No extra hosts.

A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.

Returns:

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


229
230
231
# File 'ecs/container_definition_options.rb', line 229

def extra_hosts
  @extra_hosts
end

#gpu_countNumeric? (readonly)

Note:

Default: - No GPUs assigned.

The number of GPUs assigned to the container.

Returns:

  • (Numeric, nil)


234
235
236
# File 'ecs/container_definition_options.rb', line 234

def gpu_count
  @gpu_count
end

#health_checkAWSCDK::ECS::HealthCheck? (readonly)

Note:

Default: - Health check configuration from container.

The health check command and associated configuration parameters for the container.

Returns:



239
240
241
# File 'ecs/container_definition_options.rb', line 239

def health_check
  @health_check
end

#hostnameString? (readonly)

Note:

Default: - Automatic hostname.

The hostname to use for your container.

Returns:

  • (String, nil)


244
245
246
# File 'ecs/container_definition_options.rb', line 244

def hostname
  @hostname
end

#imageAWSCDK::ECS::ContainerImage (readonly)

The image used to start a container.

This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage



134
135
136
# File 'ecs/container_definition_options.rb', line 134

def image
  @image
end

#inference_accelerator_resourcesArray<String>? (readonly)

Note:

Default: - No inference accelerators assigned.

The inference accelerators referenced by the container.

Returns:

  • (Array<String>, nil)


249
250
251
# File 'ecs/container_definition_options.rb', line 249

def inference_accelerator_resources
  @inference_accelerator_resources
end

#interactiveBoolean? (readonly)

Note:

Default: - false

When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.



255
256
257
# File 'ecs/container_definition_options.rb', line 255

def interactive
  @interactive
end

#linux_parametersAWSCDK::ECS::LinuxParameters? (readonly)

Note:

Default: - No Linux parameters.

Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.

For more information see KernelCapabilities.



262
263
264
# File 'ecs/container_definition_options.rb', line 262

def linux_parameters
  @linux_parameters
end

#loggingAWSCDK::ECS::LogDriver? (readonly)

Note:

Default: - Containers use the same logging driver that the Docker daemon uses.

The log configuration specification for the container.

Returns:



267
268
269
# File 'ecs/container_definition_options.rb', line 267

def logging
  @logging
end

#memory_limit_mibNumeric? (readonly)

Note:

Default: - No memory limit.

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

If your container attempts to exceed the allocated memory, the container is terminated.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Returns:

  • (Numeric, nil)


277
278
279
# File 'ecs/container_definition_options.rb', line 277

def memory_limit_mib
  @memory_limit_mib
end

#memory_reservation_mibNumeric? (readonly)

Note:

Default: - No memory reserved.

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

When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Returns:

  • (Numeric, nil)


290
291
292
# File 'ecs/container_definition_options.rb', line 290

def memory_reservation_mib
  @memory_reservation_mib
end

#port_mappingsArray<AWSCDK::ECS::PortMapping>? (readonly)

Note:

Default: - No ports are mapped.

The port mappings to add to the container definition.

Returns:



295
296
297
# File 'ecs/container_definition_options.rb', line 295

def port_mappings
  @port_mappings
end

#privilegedBoolean? (readonly)

Note:

Default: false

Specifies whether the container is marked as privileged.

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

Returns:

  • (Boolean, nil)


302
303
304
# File 'ecs/container_definition_options.rb', line 302

def privileged
  @privileged
end

#pseudo_terminalBoolean? (readonly)

Note:

Default: - false

When this parameter is true, a TTY is allocated.

This parameter maps to Tty in the "Create a container section" of the Docker Remote API and the --tty option to docker run.



311
312
313
# File 'ecs/container_definition_options.rb', line 311

def pseudo_terminal
  @pseudo_terminal
end

#readonly_root_filesystemBoolean? (readonly)

Note:

Default: false

When this parameter is true, the container is given read-only access to its root file system.

Returns:

  • (Boolean, nil)


316
317
318
# File 'ecs/container_definition_options.rb', line 316

def readonly_root_filesystem
  @readonly_root_filesystem
end

#restart_attempt_periodAWSCDK::Duration? (readonly)

Note:

Default: - Duration.seconds(300) if enableRestartPolicy is true, otherwise no period.

A period of time that the container must run for before a restart can be attempted.

A container can be restarted only once every restart_attempt_period seconds. If a container isn't able to run for this time period and exits early, it will not be restarted.

This property can't be used if enable_restart_policy is set to false.

You can set a minimum restart_attempt_period of 60 seconds and a maximum restart_attempt_period of 1800 seconds.

Returns:



329
330
331
# File 'ecs/container_definition_options.rb', line 329

def restart_attempt_period
  @restart_attempt_period
end

#restart_ignored_exit_codesArray<Numeric>? (readonly)

Note:

Default: - No exit codes are ignored.

A list of exit codes that Amazon ECS will ignore and not attempt a restart on.

This property can't be used if enable_restart_policy is set to false.

You can specify a maximum of 50 container exit codes.

Returns:

  • (Array<Numeric>, nil)


338
339
340
# File 'ecs/container_definition_options.rb', line 338

def restart_ignored_exit_codes
  @restart_ignored_exit_codes
end

#secretsHash{String => AWSCDK::ECS::Secret}? (readonly)

Note:

Default: - No secret environment variables.

The secret environment variables to pass to the container.

Returns:



343
344
345
# File 'ecs/container_definition_options.rb', line 343

def secrets
  @secrets
end

#start_timeoutAWSCDK::Duration? (readonly)

Note:

Default: - none

Time duration (in seconds) to wait before giving up on resolving dependencies for a container.

Returns:



348
349
350
# File 'ecs/container_definition_options.rb', line 348

def start_timeout
  @start_timeout
end

#stop_timeoutAWSCDK::Duration? (readonly)

Note:

Default: - none

Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.

Returns:



353
354
355
# File 'ecs/container_definition_options.rb', line 353

def stop_timeout
  @stop_timeout
end

#system_controlsArray<AWSCDK::ECS::SystemControl>? (readonly)

Note:

Default: - No system controls are set.

A list of namespaced kernel parameters to set in the container.



359
360
361
# File 'ecs/container_definition_options.rb', line 359

def system_controls
  @system_controls
end

#ulimitsArray<AWSCDK::ECS::Ulimit>? (readonly)

An array of ulimits to set in the container.

Returns:



363
364
365
# File 'ecs/container_definition_options.rb', line 363

def ulimits
  @ulimits
end

#userString? (readonly)

Note:

Default: root

The user to use inside the container.

This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run.



371
372
373
# File 'ecs/container_definition_options.rb', line 371

def user
  @user
end

#version_consistencyAWSCDK::ECS::VersionConsistency? (readonly)

Note:

Default: VersionConsistency.DISABLED if image is a CDK asset, VersionConsistency.ENABLED otherwise

Specifies whether Amazon ECS will resolve the container image tag provided in the container definition to an image digest.

If you set the value for a container as disabled, Amazon ECS will not resolve the provided container image tag to a digest and will use the original image URI specified in the container definition for deployment.



381
382
383
# File 'ecs/container_definition_options.rb', line 381

def version_consistency
  @version_consistency
end

#working_directoryString? (readonly)

Note:

Default: /

The working directory in which to run commands inside the container.

Returns:

  • (String, nil)


386
387
388
# File 'ecs/container_definition_options.rb', line 386

def working_directory
  @working_directory
end

Class Method Details

.jsii_propertiesObject



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'ecs/container_definition_options.rb', line 388

def self.jsii_properties
  {
    :image => "image",
    :command => "command",
    :container_name => "containerName",
    :cpu => "cpu",
    :credential_specs => "credentialSpecs",
    :disable_networking => "disableNetworking",
    :dns_search_domains => "dnsSearchDomains",
    :dns_servers => "dnsServers",
    :docker_labels => "dockerLabels",
    :docker_security_options => "dockerSecurityOptions",
    :enable_restart_policy => "enableRestartPolicy",
    :entry_point => "entryPoint",
    :environment => "environment",
    :environment_files => "environmentFiles",
    :essential => "essential",
    :extra_hosts => "extraHosts",
    :gpu_count => "gpuCount",
    :health_check => "healthCheck",
    :hostname => "hostname",
    :inference_accelerator_resources => "inferenceAcceleratorResources",
    :interactive => "interactive",
    :linux_parameters => "linuxParameters",
    :logging => "logging",
    :memory_limit_mib => "memoryLimitMiB",
    :memory_reservation_mib => "memoryReservationMiB",
    :port_mappings => "portMappings",
    :privileged => "privileged",
    :pseudo_terminal => "pseudoTerminal",
    :readonly_root_filesystem => "readonlyRootFilesystem",
    :restart_attempt_period => "restartAttemptPeriod",
    :restart_ignored_exit_codes => "restartIgnoredExitCodes",
    :secrets => "secrets",
    :start_timeout => "startTimeout",
    :stop_timeout => "stopTimeout",
    :system_controls => "systemControls",
    :ulimits => "ulimits",
    :user => "user",
    :version_consistency => "versionConsistency",
    :working_directory => "workingDirectory",
  }
end

Instance Method Details

#to_jsiiObject



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'ecs/container_definition_options.rb', line 432

def to_jsii
  result = {}
  result.merge!({
    "image" => @image,
    "command" => @command,
    "containerName" => @container_name,
    "cpu" => @cpu,
    "credentialSpecs" => @credential_specs,
    "disableNetworking" => @disable_networking,
    "dnsSearchDomains" => @dns_search_domains,
    "dnsServers" => @dns_servers,
    "dockerLabels" => @docker_labels,
    "dockerSecurityOptions" => @docker_security_options,
    "enableRestartPolicy" => @enable_restart_policy,
    "entryPoint" => @entry_point,
    "environment" => @environment,
    "environmentFiles" => @environment_files,
    "essential" => @essential,
    "extraHosts" => @extra_hosts,
    "gpuCount" => @gpu_count,
    "healthCheck" => @health_check,
    "hostname" => @hostname,
    "inferenceAcceleratorResources" => @inference_accelerator_resources,
    "interactive" => @interactive,
    "linuxParameters" => @linux_parameters,
    "logging" => @logging,
    "memoryLimitMiB" => @memory_limit_mib,
    "memoryReservationMiB" => @memory_reservation_mib,
    "portMappings" => @port_mappings,
    "privileged" => @privileged,
    "pseudoTerminal" => @pseudo_terminal,
    "readonlyRootFilesystem" => @readonly_root_filesystem,
    "restartAttemptPeriod" => @restart_attempt_period,
    "restartIgnoredExitCodes" => @restart_ignored_exit_codes,
    "secrets" => @secrets,
    "startTimeout" => @start_timeout,
    "stopTimeout" => @stop_timeout,
    "systemControls" => @system_controls,
    "ulimits" => @ulimits,
    "user" => @user,
    "versionConsistency" => @version_consistency,
    "workingDirectory" => @working_directory,
  })
  result.compact
end