Skip to content

aws.ecs.describe_container_instances

Example SQL Queries

SELECT * FROM
aws.ecs.describe_container_instances
WHERE
"container_instances" = 'VALUE';

Description

Describes one or more container instances. Returns metadata about each container instance requested.

Table Definition

Column NameColumn Data Type
cluster Input Column

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the container instance or container instances you are describing were launched in any cluster other than the default cluster.

VARCHAR
include Input Column

Specifies whether you want to see the resource tags for the container instance. If TAGS is specified, the tags are included in the response. If CONTAINER_INSTANCE_HEALTH is specified, the container instance health is included in the response. If this field is omitted, tags and container instance health status aren't included in the response.

VARCHAR[]
Show child fields
include[]
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
_input_container_instances Input Column
VARCHAR[]
Show child fields
_input_container_instances[]
container_instances

The list of container instances.

STRUCT(
"container_instance_arn" VARCHAR,
"ec2_instance_id" VARCHAR,
"capacity_provider_name" VARCHAR,
"version" BIGINT,
"version_info" STRUCT(
"agent_version" VARCHAR,
"agent_hash" VARCHAR,
"docker_version" VARCHAR
),
"remaining_resources" STRUCT(
"name" VARCHAR,
"type" VARCHAR,
"double_value" DOUBLE,
"long_value" BIGINT,
"integer_value" BIGINT,
"string_set_value" VARCHAR[]
)[],
"registered_resources" STRUCT(
"name" VARCHAR,
"type" VARCHAR,
"double_value" DOUBLE,
"long_value" BIGINT,
"integer_value" BIGINT,
"string_set_value" VARCHAR[]
)[],
"status" VARCHAR,
"status_reason" VARCHAR,
"agent_connected" BOOLEAN,
"running_tasks_count" BIGINT,
"pending_tasks_count" BIGINT,
"agent_update_status" VARCHAR,
"attributes" STRUCT(
"name" VARCHAR,
"value" VARCHAR,
"target_type" VARCHAR,
"target_id" VARCHAR
)[],
"registered_at" TIMESTAMP_S,
"attachments" STRUCT(
"id" VARCHAR,
"type" VARCHAR,
"status" VARCHAR,
"details" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
)[],
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"health_status" STRUCT(
"overall_status" VARCHAR,
"details" STRUCT(
"type" VARCHAR,
"status" VARCHAR,
"last_updated" TIMESTAMP_S,
"last_status_change" TIMESTAMP_S
)[]
)
)[]
Show child fields
container_instances[]
Show child fields
container_instances[].agent_connected

This parameter returns true if the agent is connected to Amazon ECS. An instance with an agent that may be unhealthy or stopped return false. Only instances connected to an agent can accept task placement requests.

container_instances[].agent_update_status

The status of the most recent agent update. If an update wasn't ever requested, this value is NULL.

container_instances[].attachments[]
Show child fields
container_instances[].attachments[].details[]
Show child fields
container_instances[].attachments[].details[].name

The name of the key-value pair. For environment variables, this is the name of the environment variable.

container_instances[].attachments[].details[].value

The value of the key-value pair. For environment variables, this is the value of the environment variable.

container_instances[].attachments[].id

The unique identifier for the attachment.

container_instances[].attachments[].status

The status of the attachment. Valid values are PRECREATED, CREATED, ATTACHING, ATTACHED, DETACHING, DETACHED, DELETED, and FAILED.

container_instances[].attachments[].type

The type of the attachment, such as ElasticNetworkInterface, Service Connect, and AmazonElasticBlockStorage.

container_instances[].attributes[]
Show child fields
container_instances[].attributes[].name

The name of the attribute. The name must contain between 1 and 128 characters. The name may contain letters (uppercase and lowercase), numbers, hyphens (-), underscores (_), forward slashes (/), back slashes (\), or periods (.).

container_instances[].attributes[].target_id

The ID of the target. You can specify the short form ID for a resource or the full Amazon Resource Name (ARN).

container_instances[].attributes[].target_type

The type of the target to attach the attribute with. This parameter is required if you use the short form ID for a resource instead of the full ARN.

container_instances[].attributes[].value

The value of the attribute. The value must contain between 1 and 128 characters. It can contain letters (uppercase and lowercase), numbers, hyphens (-), underscores (_), periods (.), at signs (@), forward slashes (/), back slashes (\), colons (:), or spaces. The value can't start or end with a space.

container_instances[].capacity_provider_name

The capacity provider that's associated with the container instance.

container_instances[].container_instance_arn

The Amazon Resource Name (ARN) of the container instance. For more information about the ARN format, see Amazon Resource Name (ARN) in the Amazon ECS Developer Guide.

container_instances[].ec2_instance_id

The ID of the container instance. For Amazon EC2 instances, this value is the Amazon EC2 instance ID. For external instances, this value is the Amazon Web Services Systems Manager managed instance ID.

container_instances[].health_status

An object representing the health status of the container instance.

Show child fields
container_instances[].health_status.details[]
Show child fields
container_instances[].health_status.details[].last_status_change

The Unix timestamp for when the container instance health status last changed.

container_instances[].health_status.details[].last_updated

The Unix timestamp for when the container instance health status was last updated.

container_instances[].health_status.details[].status

The container instance health status.

container_instances[].health_status.details[].type

The type of container instance health status that was verified.

container_instances[].health_status.overall_status

The overall health status of the container instance. This is an aggregate status of all container instance health checks.

container_instances[].pending_tasks_count

The number of tasks on the container instance that are in the PENDING status.

container_instances[].registered_at

The Unix timestamp for the time when the container instance was registered.

container_instances[].registered_resources[]
Show child fields
container_instances[].registered_resources[].double_value

When the doubleValue type is set, the value of the resource must be a double precision floating-point type.

container_instances[].registered_resources[].integer_value

When the integerValue type is set, the value of the resource must be an integer.

container_instances[].registered_resources[].long_value

When the longValue type is set, the value of the resource must be an extended precision floating-point type.

container_instances[].registered_resources[].name

The name of the resource, such as CPU, MEMORY, PORTS, PORTS_UDP, or a user-defined resource.

container_instances[].registered_resources[].string_set_value[]
container_instances[].registered_resources[].type

The type of the resource. Valid values: INTEGER, DOUBLE, LONG, or STRINGSET.

container_instances[].remaining_resources[]
Show child fields
container_instances[].remaining_resources[].double_value

When the doubleValue type is set, the value of the resource must be a double precision floating-point type.

container_instances[].remaining_resources[].integer_value

When the integerValue type is set, the value of the resource must be an integer.

container_instances[].remaining_resources[].long_value

When the longValue type is set, the value of the resource must be an extended precision floating-point type.

container_instances[].remaining_resources[].name

The name of the resource, such as CPU, MEMORY, PORTS, PORTS_UDP, or a user-defined resource.

container_instances[].remaining_resources[].string_set_value[]
container_instances[].remaining_resources[].type

The type of the resource. Valid values: INTEGER, DOUBLE, LONG, or STRINGSET.

container_instances[].running_tasks_count

The number of tasks on the container instance that have a desired status (desiredStatus) of RUNNING.

container_instances[].status

The status of the container instance. The valid values are REGISTERING, REGISTRATION_FAILED, ACTIVE, INACTIVE, DEREGISTERING, or DRAINING.

If your account has opted in to the awsvpcTrunking account setting, then any newly registered container instance will transition to a REGISTERING status while the trunk elastic network interface is provisioned for the instance. If the registration fails, the instance will transition to a REGISTRATION_FAILED status. You can describe the container instance and see the reason for failure in the statusReason parameter. Once the container instance is terminated, the instance transitions to a DEREGISTERING status while the trunk elastic network interface is deprovisioned. The instance then transitions to an INACTIVE status.

The ACTIVE status indicates that the container instance can accept tasks. The DRAINING indicates that new tasks aren't placed on the container instance and any service tasks running on the container instance are removed if possible. For more information, see Container instance draining in the Amazon Elastic Container Service Developer Guide.

container_instances[].status_reason

The reason that the container instance reached its current status.

container_instances[].tags[]
Show child fields
container_instances[].tags[].key

One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.

container_instances[].tags[].value

The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).

container_instances[].version

The version counter for the container instance. Every time a container instance experiences a change that triggers a CloudWatch event, the version counter is incremented. If you're replicating your Amazon ECS container instance state with CloudWatch Events, you can compare the version of a container instance reported by the Amazon ECS APIs with the version reported in CloudWatch Events for the container instance (inside the detail object) to verify that the version in your event stream is current.

container_instances[].version_info

The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

Show child fields
container_instances[].version_info.agent_hash

The Git commit hash for the Amazon ECS container agent build on the amazon-ecs-agent GitHub repository.

container_instances[].version_info.agent_version

The version number of the Amazon ECS container agent.

container_instances[].version_info.docker_version

The Docker version that's running on the container instance.

failures

Any failures associated with the call.

STRUCT(
"arn" VARCHAR,
"reason" VARCHAR,
"detail" VARCHAR
)[]
Show child fields
failures[]
Show child fields
failures[].arn

The Amazon Resource Name (ARN) of the failed resource.

failures[].detail

The details of the failure.

failures[].reason

The reason for the failure.