Class: AWSCDK::ECS::CfnDaemonTaskDefinition::DaemonContainerDefinitionProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::CfnDaemonTaskDefinition::DaemonContainerDefinitionProperty
- Defined in:
- ecs/cfn_daemon_task_definition.rb
Overview
A container definition for a daemon task.
Daemon container definitions describe the containers that run as part of a daemon task on container instances managed by capacity providers.
Instance Attribute Summary collapse
-
#command ⇒ Array<String>?
readonly
The command that's passed to the container.
-
#cpu ⇒ Numeric?
readonly
The number of
cpuunits reserved for the container. -
#depends_on ⇒ AWSCDK::IResolvable, ...
readonly
The dependencies defined for container startup and shutdown.
-
#entry_point ⇒ Array<String>?
readonly
The entry point that's passed to the container.
-
#environment ⇒ AWSCDK::IResolvable, ...
readonly
The environment variables to pass to a container.
-
#environment_files ⇒ AWSCDK::IResolvable, ...
readonly
A list of files containing the environment variables to pass to a container.
-
#essential ⇒ Boolean, ...
readonly
If the
essentialparameter of a container is marked astrue, and that container fails or stops for any reason, all other containers that are part of the task are stopped. -
#firelens_configuration ⇒ AWSCDK::IResolvable, ...
readonly
The FireLens configuration for the container.
-
#health_check ⇒ AWSCDK::IResolvable, ...
readonly
An object representing a container health check.
-
#image ⇒ String
readonly
The image used to start the container.
-
#interactive ⇒ Boolean, ...
readonly
When this parameter is
true, you can deploy containerized applications that requirestdinor attyto be allocated. -
#linux_parameters ⇒ AWSCDK::IResolvable, ...
readonly
The Linux-specific options that are applied to the container, such as Linux KernelCapabilities.
-
#log_configuration ⇒ AWSCDK::IResolvable, ...
readonly
The log configuration for the container.
-
#memory ⇒ Numeric?
readonly
The amount (in MiB) of memory to present to the container.
-
#memory_reservation ⇒ Numeric?
readonly
The soft limit (in MiB) of memory to reserve for the container.
-
#mount_points ⇒ AWSCDK::IResolvable, ...
readonly
The mount points for data volumes in your container.
-
#name ⇒ String
readonly
The name of the container.
-
#privileged ⇒ Boolean, ...
readonly
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the
rootuser). -
#pseudo_terminal ⇒ Boolean, ...
readonly
When this parameter is
true, a TTY is allocated. -
#readonly_root_filesystem ⇒ Boolean, ...
readonly
When this parameter is true, the container is given read-only access to its root file system.
-
#repository_credentials ⇒ AWSCDK::IResolvable, ...
readonly
The repository credentials for private registry authentication.
- #restart_policy ⇒ AWSCDK::IResolvable, ... readonly
-
#secrets ⇒ AWSCDK::IResolvable, ...
readonly
The secrets to pass to the container.
-
#start_timeout ⇒ Numeric?
readonly
Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
-
#stop_timeout ⇒ Numeric?
readonly
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
-
#system_controls ⇒ AWSCDK::IResolvable, ...
readonly
A list of namespaced kernel parameters to set in the container.
-
#ulimits ⇒ AWSCDK::IResolvable, ...
readonly
A list of
ulimitsto set in the container. -
#user ⇒ String?
readonly
The user to use inside the container.
-
#working_directory ⇒ String?
readonly
The working directory to run commands inside the container in.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image:, name:, command: nil, cpu: nil, depends_on: nil, entry_point: nil, environment: nil, environment_files: nil, essential: nil, firelens_configuration: nil, health_check: nil, interactive: nil, linux_parameters: nil, log_configuration: nil, memory: nil, memory_reservation: nil, mount_points: nil, privileged: nil, pseudo_terminal: nil, readonly_root_filesystem: nil, repository_credentials: nil, restart_policy: nil, secrets: nil, start_timeout: nil, stop_timeout: nil, system_controls: nil, ulimits: nil, user: nil, working_directory: nil) ⇒ DaemonContainerDefinitionProperty
constructor
A new instance of DaemonContainerDefinitionProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image:, name:, command: nil, cpu: nil, depends_on: nil, entry_point: nil, environment: nil, environment_files: nil, essential: nil, firelens_configuration: nil, health_check: nil, interactive: nil, linux_parameters: nil, log_configuration: nil, memory: nil, memory_reservation: nil, mount_points: nil, privileged: nil, pseudo_terminal: nil, readonly_root_filesystem: nil, repository_credentials: nil, restart_policy: nil, secrets: nil, start_timeout: nil, stop_timeout: nil, system_controls: nil, ulimits: nil, user: nil, working_directory: nil) ⇒ DaemonContainerDefinitionProperty
Returns a new instance of DaemonContainerDefinitionProperty.
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 |
# File 'ecs/cfn_daemon_task_definition.rb', line 721 def initialize(image:, name:, command: nil, cpu: nil, depends_on: nil, entry_point: nil, environment: nil, environment_files: nil, essential: nil, firelens_configuration: nil, health_check: nil, interactive: nil, linux_parameters: nil, log_configuration: nil, memory: nil, memory_reservation: nil, mount_points: nil, privileged: nil, pseudo_terminal: nil, readonly_root_filesystem: nil, repository_credentials: nil, restart_policy: nil, secrets: nil, start_timeout: nil, stop_timeout: nil, system_controls: nil, ulimits: nil, user: nil, working_directory: nil) @image = image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "image") @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @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? @depends_on = depends_on Jsii::Type.check_type(@depends_on, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLkNvbnRhaW5lckRlcGVuZGVuY3lQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "dependsOn") unless @depends_on.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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLktleVZhbHVlUGFpclByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "environment") unless @environment.nil? @environment_files = environment_files Jsii::Type.check_type(@environment_files, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLkVudmlyb25tZW50RmlsZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "environmentFiles") unless @environment_files.nil? @essential = essential Jsii::Type.check_type(@essential, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "essential") unless @essential.nil? @firelens_configuration = firelens_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::FirelensConfigurationProperty.new(**firelens_configuration.transform_keys(&:to_sym)) : firelens_configuration Jsii::Type.check_type(@firelens_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uRmlyZWxlbnNDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "firelensConfiguration") unless @firelens_configuration.nil? @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::HealthCheckProperty.new(**health_check.transform_keys(&:to_sym)) : health_check Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uSGVhbHRoQ2hlY2tQcm9wZXJ0eSJ9XX19")), "healthCheck") unless @health_check.nil? @interactive = interactive Jsii::Type.check_type(@interactive, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "interactive") unless @interactive.nil? @linux_parameters = linux_parameters.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::LinuxParametersProperty.new(**linux_parameters.transform_keys(&:to_sym)) : linux_parameters Jsii::Type.check_type(@linux_parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uTGludXhQYXJhbWV0ZXJzUHJvcGVydHkifV19fQ==")), "linuxParameters") unless @linux_parameters.nil? @log_configuration = log_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::LogConfigurationProperty.new(**log_configuration.transform_keys(&:to_sym)) : log_configuration Jsii::Type.check_type(@log_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uTG9nQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "logConfiguration") unless @log_configuration.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? @mount_points = mount_points Jsii::Type.check_type(@mount_points, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLk1vdW50UG9pbnRQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "mountPoints") unless @mount_points.nil? @privileged = privileged Jsii::Type.check_type(@privileged, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "privileged") unless @privileged.nil? @pseudo_terminal = pseudo_terminal Jsii::Type.check_type(@pseudo_terminal, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "pseudoTerminal") unless @pseudo_terminal.nil? @readonly_root_filesystem = readonly_root_filesystem Jsii::Type.check_type(@readonly_root_filesystem, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "readonlyRootFilesystem") unless @readonly_root_filesystem.nil? @repository_credentials = repository_credentials.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::RepositoryCredentialsProperty.new(**repository_credentials.transform_keys(&:to_sym)) : repository_credentials Jsii::Type.check_type(@repository_credentials, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uUmVwb3NpdG9yeUNyZWRlbnRpYWxzUHJvcGVydHkifV19fQ==")), "repositoryCredentials") unless @repository_credentials.nil? @restart_policy = restart_policy.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::RestartPolicyProperty.new(**restart_policy.transform_keys(&:to_sym)) : restart_policy Jsii::Type.check_type(@restart_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uUmVzdGFydFBvbGljeVByb3BlcnR5In1dfX0=")), "restartPolicy") unless @restart_policy.nil? @secrets = secrets Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLlNlY3JldFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "secrets") unless @secrets.nil? @start_timeout = start_timeout Jsii::Type.check_type(@start_timeout, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "startTimeout") unless @start_timeout.nil? @stop_timeout = stop_timeout Jsii::Type.check_type(@stop_timeout, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "stopTimeout") unless @stop_timeout.nil? @system_controls = system_controls Jsii::Type.check_type(@system_controls, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLlN5c3RlbUNvbnRyb2xQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "systemControls") unless @system_controls.nil? @ulimits = ulimits Jsii::Type.check_type(@ulimits, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkRhZW1vblRhc2tEZWZpbml0aW9uLlVsaW1pdFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "ulimits") unless @ulimits.nil? @user = user Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "user") unless @user.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
#command ⇒ Array<String>? (readonly)
The command that's passed to the container.
800 801 802 |
# File 'ecs/cfn_daemon_task_definition.rb', line 800 def command @command end |
#cpu ⇒ Numeric? (readonly)
The number of cpu units reserved for the container.
805 806 807 |
# File 'ecs/cfn_daemon_task_definition.rb', line 805 def cpu @cpu end |
#depends_on ⇒ AWSCDK::IResolvable, ... (readonly)
The dependencies defined for container startup and shutdown.
A container can contain multiple dependencies on other containers in a task definition.
812 813 814 |
# File 'ecs/cfn_daemon_task_definition.rb', line 812 def depends_on @depends_on end |
#entry_point ⇒ Array<String>? (readonly)
The entry point that's passed to the container.
817 818 819 |
# File 'ecs/cfn_daemon_task_definition.rb', line 817 def entry_point @entry_point end |
#environment ⇒ AWSCDK::IResolvable, ... (readonly)
The environment variables to pass to a container.
822 823 824 |
# File 'ecs/cfn_daemon_task_definition.rb', line 822 def environment @environment end |
#environment_files ⇒ AWSCDK::IResolvable, ... (readonly)
A list of files containing the environment variables to pass to a container.
827 828 829 |
# File 'ecs/cfn_daemon_task_definition.rb', line 827 def environment_files @environment_files end |
#essential ⇒ Boolean, ... (readonly)
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.
832 833 834 |
# File 'ecs/cfn_daemon_task_definition.rb', line 832 def essential @essential end |
#firelens_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
The FireLens configuration for the container.
This is used to specify and configure a log router for container logs. For more information, see Custom log routing in the Amazon Elastic Container Service Developer Guide.
839 840 841 |
# File 'ecs/cfn_daemon_task_definition.rb', line 839 def firelens_configuration @firelens_configuration end |
#health_check ⇒ AWSCDK::IResolvable, ... (readonly)
An object representing a container health check.
Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image (such as those specified in a parent image or from the image's Dockerfile). This configuration maps to the HEALTHCHECK parameter of docker run.
The Amazon ECS container agent only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor Docker health checks that are embedded in a container image and not specified in the container definition. Health check parameters that are specified in a container definition override any Docker health checks that exist in the container image.
You can view the health status of both individual containers and a task with the DescribeTasks API operation or when viewing the task details in the console.
The health check is designed to make sure that your containers survive agent restarts, upgrades, or temporary unavailability.
Amazon ECS performs health checks on containers with the default that launched the container instance or the task.
The following describes the possible health_status values for a container:
HEALTHY-The container health check has passed successfully.UNHEALTHY-The container health check has failed.UNKNOWN-The container health check is being evaluated, there's no container health check defined, or Amazon ECS doesn't have the health status of the container.
The following describes the possible health_status values based on the container health checker status of essential containers in the task with the following priority order (high to low):
UNHEALTHY-One or more essential containers have failed their health check.UNKNOWN-Any essential container running within the task is in anUNKNOWNstate and no other essential containers have anUNHEALTHYstate.HEALTHY-All essential containers within the task have passed their health checks.
Consider the following task health example with 2 containers.
- If Container1 is
UNHEALTHYand Container2 isUNKNOWN, the task health isUNHEALTHY. - If Container1 is
UNHEALTHYand Container2 isHEALTHY, the task health isUNHEALTHY. - If Container1 is
HEALTHYand Container2 isUNKNOWN, the task health isUNKNOWN. - If Container1 is
HEALTHYand Container2 isHEALTHY, the task health isHEALTHY.
Consider the following task health example with 3 containers.
- If Container1 is
UNHEALTHYand Container2 isUNKNOWN, and Container3 isUNKNOWN, the task health isUNHEALTHY. - If Container1 is
UNHEALTHYand Container2 isUNKNOWN, and Container3 isHEALTHY, the task health isUNHEALTHY. - If Container1 is
UNHEALTHYand Container2 isHEALTHY, and Container3 isHEALTHY, the task health isUNHEALTHY. - If Container1 is
HEALTHYand Container2 isUNKNOWN, and Container3 isHEALTHY, the task health isUNKNOWN. - If Container1 is
HEALTHYand Container2 isUNKNOWN, and Container3 isUNKNOWN, the task health isUNKNOWN. - If Container1 is
HEALTHYand Container2 isHEALTHY, and Container3 isHEALTHY, the task health isHEALTHY.
If a task is run manually, and not as part of a service, the task will continue its lifecycle regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the task will be stopped and the service scheduler will replace it. When a container health check fails for a task that is part of a service, the following process occurs:
- The task is marked as
UNHEALTHY. - The unhealthy task will be stopped, and during the stopping process, it will go through the following states:
DEACTIVATING- In this state, Amazon ECS performs additional steps before stopping the task. For example, for tasks that are part of services configured to use Elastic Load Balancing target groups, target groups will be deregistered in this state.STOPPING- The task is in the process of being stopped.DEPROVISIONING- Resources associated with the task are being cleaned up.STOPPED- The task has been completely stopped.
- After the old task stops, a new task will be launched to ensure service operation, and the new task will go through the following lifecycle:
PROVISIONING- Resources required for the task are being provisioned.PENDING- The task is waiting to be placed on a container instance.ACTIVATING- In this state, Amazon ECS pulls container images, creates containers, configures task networking, registers load balancer target groups, and configures service discovery status.RUNNING- The task is running and performing its work.
For more detailed information about task lifecycle states, see Task lifecycle in the Amazon Elastic Container Service Developer Guide. The following are notes about container health check support:
- If the Amazon ECS container agent becomes disconnected from the Amazon ECS service, this won't cause a container to transition to an
UNHEALTHYstatus. This is by design, to ensure that containers remain running during agent restarts or temporary unavailability. The health check status is the "last heard from" response from the Amazon ECS agent, so if the container was consideredHEALTHYprior to the disconnect, that status will remain until the agent reconnects and another health check occurs. There are no assumptions made about the status of the container health checks. - Container health checks require version
1.17.0or greater of the Amazon ECS container agent. For more information, see Updating the Amazon ECS container agent. - Container health checks are supported for Fargate tasks if you're using platform version
1.1.0or greater. For more information, see platform versions. - Container health checks aren't supported for tasks that are part of a service that's configured to use a Classic Load Balancer.
For an example of how to specify a task definition with multiple containers where container dependency is specified, see Container dependency in the Amazon Elastic Container Service Developer Guide.
905 906 907 |
# File 'ecs/cfn_daemon_task_definition.rb', line 905 def health_check @health_check end |
#image ⇒ String (readonly)
The image used to start the 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.
788 789 790 |
# File 'ecs/cfn_daemon_task_definition.rb', line 788 def image @image end |
#interactive ⇒ Boolean, ... (readonly)
When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.
910 911 912 |
# File 'ecs/cfn_daemon_task_definition.rb', line 910 def interactive @interactive end |
#linux_parameters ⇒ AWSCDK::IResolvable, ... (readonly)
The Linux-specific options that are applied to the container, such as Linux KernelCapabilities.
915 916 917 |
# File 'ecs/cfn_daemon_task_definition.rb', line 915 def linux_parameters @linux_parameters end |
#log_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
The log configuration for the container.
This parameter maps to LogConfig in the docker container create command and the --log-driver option to docker run.
By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition.
Understand the following when specifying a log configuration for your containers.
- Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be available in future releases of the Amazon ECS container agent.
For tasks on FARGATElong, the supported log drivers are
awslogs,splunk, andawsfirelens. For tasks hosted on Amazon EC2 instances, the supported log drivers areawslogs,fluentd,gelf,json-file,journald,syslog,splunk, andawsfirelens. - This parameter requires version 1.18 of the Docker Remote API or greater on your container instance.
- For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must register the available logging drivers with the
ECS_AVAILABLE_LOGGING_DRIVERSenvironment variable before containers placed on that instance can use these log configuration options. For more information, see Amazon ECS container agent configuration in the Amazon Elastic Container Service Developer Guide. - For tasks that are on FARGATElong, because you don't have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to send Gelf logs to.
931 932 933 |
# File 'ecs/cfn_daemon_task_definition.rb', line 931 def log_configuration @log_configuration end |
#memory ⇒ Numeric? (readonly)
The amount (in MiB) of memory to present to the container.
If the container attempts to exceed the memory specified here, the container is killed.
938 939 940 |
# File 'ecs/cfn_daemon_task_definition.rb', line 938 def memory @memory end |
#memory_reservation ⇒ Numeric? (readonly)
The soft limit (in MiB) of memory to reserve for the container.
943 944 945 |
# File 'ecs/cfn_daemon_task_definition.rb', line 943 def memory_reservation @memory_reservation end |
#mount_points ⇒ AWSCDK::IResolvable, ... (readonly)
The mount points for data volumes in your container.
948 949 950 |
# File 'ecs/cfn_daemon_task_definition.rb', line 948 def mount_points @mount_points end |
#name ⇒ String (readonly)
The name of the container.
Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
795 796 797 |
# File 'ecs/cfn_daemon_task_definition.rb', line 795 def name @name end |
#privileged ⇒ Boolean, ... (readonly)
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
953 954 955 |
# File 'ecs/cfn_daemon_task_definition.rb', line 953 def privileged @privileged end |
#pseudo_terminal ⇒ Boolean, ... (readonly)
When this parameter is true, a TTY is allocated.
958 959 960 |
# File 'ecs/cfn_daemon_task_definition.rb', line 958 def pseudo_terminal @pseudo_terminal end |
#readonly_root_filesystem ⇒ Boolean, ... (readonly)
When this parameter is true, the container is given read-only access to its root file system.
963 964 965 |
# File 'ecs/cfn_daemon_task_definition.rb', line 963 def readonly_root_filesystem @readonly_root_filesystem end |
#repository_credentials ⇒ AWSCDK::IResolvable, ... (readonly)
The repository credentials for private registry authentication.
968 969 970 |
# File 'ecs/cfn_daemon_task_definition.rb', line 968 def repository_credentials @repository_credentials end |
#restart_policy ⇒ AWSCDK::IResolvable, ... (readonly)
971 972 973 |
# File 'ecs/cfn_daemon_task_definition.rb', line 971 def restart_policy @restart_policy end |
#secrets ⇒ AWSCDK::IResolvable, ... (readonly)
The secrets to pass to the container.
976 977 978 |
# File 'ecs/cfn_daemon_task_definition.rb', line 976 def secrets @secrets end |
#start_timeout ⇒ Numeric? (readonly)
Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
981 982 983 |
# File 'ecs/cfn_daemon_task_definition.rb', line 981 def start_timeout @start_timeout end |
#stop_timeout ⇒ Numeric? (readonly)
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
986 987 988 |
# File 'ecs/cfn_daemon_task_definition.rb', line 986 def stop_timeout @stop_timeout end |
#system_controls ⇒ AWSCDK::IResolvable, ... (readonly)
A list of namespaced kernel parameters to set in the container.
991 992 993 |
# File 'ecs/cfn_daemon_task_definition.rb', line 991 def system_controls @system_controls end |
#ulimits ⇒ AWSCDK::IResolvable, ... (readonly)
A list of ulimits to set in the container.
996 997 998 |
# File 'ecs/cfn_daemon_task_definition.rb', line 996 def ulimits @ulimits end |
#user ⇒ String? (readonly)
The user to use inside the container.
1001 1002 1003 |
# File 'ecs/cfn_daemon_task_definition.rb', line 1001 def user @user end |
#working_directory ⇒ String? (readonly)
The working directory to run commands inside the container in.
1006 1007 1008 |
# File 'ecs/cfn_daemon_task_definition.rb', line 1006 def working_directory @working_directory end |
Class Method Details
.jsii_properties ⇒ Object
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 |
# File 'ecs/cfn_daemon_task_definition.rb', line 1008 def self.jsii_properties { :image => "image", :name => "name", :command => "command", :cpu => "cpu", :depends_on => "dependsOn", :entry_point => "entryPoint", :environment => "environment", :environment_files => "environmentFiles", :essential => "essential", :firelens_configuration => "firelensConfiguration", :health_check => "healthCheck", :interactive => "interactive", :linux_parameters => "linuxParameters", :log_configuration => "logConfiguration", :memory => "memory", :memory_reservation => "memoryReservation", :mount_points => "mountPoints", :privileged => "privileged", :pseudo_terminal => "pseudoTerminal", :readonly_root_filesystem => "readonlyRootFilesystem", :repository_credentials => "repositoryCredentials", :restart_policy => "restartPolicy", :secrets => "secrets", :start_timeout => "startTimeout", :stop_timeout => "stopTimeout", :system_controls => "systemControls", :ulimits => "ulimits", :user => "user", :working_directory => "workingDirectory", } end |
Instance Method Details
#to_jsii ⇒ Object
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 |
# File 'ecs/cfn_daemon_task_definition.rb', line 1042 def to_jsii result = {} result.merge!({ "image" => @image, "name" => @name, "command" => @command, "cpu" => @cpu, "dependsOn" => @depends_on, "entryPoint" => @entry_point, "environment" => @environment, "environmentFiles" => @environment_files, "essential" => @essential, "firelensConfiguration" => @firelens_configuration, "healthCheck" => @health_check, "interactive" => @interactive, "linuxParameters" => @linux_parameters, "logConfiguration" => @log_configuration, "memory" => @memory, "memoryReservation" => @memory_reservation, "mountPoints" => @mount_points, "privileged" => @privileged, "pseudoTerminal" => @pseudo_terminal, "readonlyRootFilesystem" => @readonly_root_filesystem, "repositoryCredentials" => @repository_credentials, "restartPolicy" => @restart_policy, "secrets" => @secrets, "startTimeout" => @start_timeout, "stopTimeout" => @stop_timeout, "systemControls" => @system_controls, "ulimits" => @ulimits, "user" => @user, "workingDirectory" => @working_directory, }) result.compact end |