Skip to content

aws.ecs.describe_clusters

Example SQL Queries

SELECT * FROM
aws.ecs.describe_clusters;

Description

Describes one or more of your clusters.

Table Definition

Column NameColumn Data Type
include Input Column

Determines whether to include additional information about the clusters in the response. If this field is omitted, this information isn't included.

If ATTACHMENTS is specified, the attachments for the container instances or tasks within the cluster are included, for example the capacity providers.

If SETTINGS is specified, the settings for the cluster are included.

If CONFIGURATIONS is specified, the configuration for the cluster is included.

If STATISTICS is specified, the task and service count is included, separated by launch type.

If TAGS is specified, the metadata tags associated with the cluster are included.

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_clusters Input Column
VARCHAR[]
Show child fields
_input_clusters[]
clusters

The list of clusters.

STRUCT(
"cluster_arn" VARCHAR,
"cluster_name" VARCHAR,
"configuration" STRUCT(
"execute_command_configuration" STRUCT(
"kms_key_id" VARCHAR,
"logging" VARCHAR,
"log_configuration" STRUCT(
"cloud_watch_log_group_name" VARCHAR,
"cloud_watch_encryption_enabled" BOOLEAN,
"s3_bucket_name" VARCHAR,
"s3_encryption_enabled" BOOLEAN,
"s3_key_prefix" VARCHAR
)
),
"managed_storage_configuration" STRUCT(
"kms_key_id" VARCHAR,
"fargate_ephemeral_storage_kms_key_id" VARCHAR
)
),
"status" VARCHAR,
"registered_container_instances_count" BIGINT,
"running_tasks_count" BIGINT,
"pending_tasks_count" BIGINT,
"active_services_count" BIGINT,
"statistics" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[],
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"settings" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[],
"capacity_providers" VARCHAR[],
"default_capacity_provider_strategy" STRUCT(
"capacity_provider" VARCHAR,
"weight" BIGINT,
"base" BIGINT
)[],
"attachments" STRUCT(
"id" VARCHAR,
"type" VARCHAR,
"status" VARCHAR,
"details" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
)[],
"attachments_status" VARCHAR,
"service_connect_defaults" STRUCT(
"namespace" VARCHAR
)
)[]
Show child fields
clusters[]
Show child fields
clusters[].active_services_count

The number of services that are running on the cluster in an ACTIVE state. You can view these services with PListServices.

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

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

clusters[].attachments[].details[].value

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

clusters[].attachments[].id

The unique identifier for the attachment.

clusters[].attachments[].status

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

clusters[].attachments[].type

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

clusters[].attachments_status

The status of the capacity providers associated with the cluster. The following are the states that are returned.

UPDATE_IN_PROGRESS

The available capacity providers for the cluster are updating.

UPDATE_COMPLETE

The capacity providers have successfully updated.

UPDATE_FAILED

The capacity provider updates failed.

clusters[].capacity_providers[]
clusters[].cluster_arn

The Amazon Resource Name (ARN) that identifies the cluster. For more information about the ARN format, see Amazon Resource Name (ARN) in the Amazon ECS Developer Guide.

clusters[].cluster_name

A user-generated string that you use to identify your cluster.

clusters[].configuration

The execute command configuration for the cluster.

Show child fields
clusters[].configuration.execute_command_configuration

The details of the execute command configuration.

Show child fields
clusters[].configuration.execute_command_configuration.kms_key_id

Specify an Key Management Service key ID to encrypt the data between the local client and the container.

clusters[].configuration.execute_command_configuration.log_configuration

The log configuration for the results of the execute command actions. The logs can be sent to CloudWatch Logs or an Amazon S3 bucket. When logging=OVERRIDE is specified, a logConfiguration must be provided.

Show child fields
clusters[].configuration.execute_command_configuration.log_configuration.cloud_watch_encryption_enabled

Determines whether to use encryption on the CloudWatch logs. If not specified, encryption will be off.

clusters[].configuration.execute_command_configuration.log_configuration.cloud_watch_log_group_name

The name of the CloudWatch log group to send logs to.

The CloudWatch log group must already be created.

clusters[].configuration.execute_command_configuration.log_configuration.s3_bucket_name

The name of the S3 bucket to send logs to.

The S3 bucket must already be created.

clusters[].configuration.execute_command_configuration.log_configuration.s3_encryption_enabled

Determines whether to use encryption on the S3 logs. If not specified, encryption is not used.

clusters[].configuration.execute_command_configuration.log_configuration.s3_key_prefix

An optional folder in the S3 bucket to place logs in.

clusters[].configuration.execute_command_configuration.logging

The log setting to use for redirecting logs for your execute command results. The following log settings are available.

  • NONE: The execute command session is not logged.

  • DEFAULT: The awslogs configuration in the task definition is used. If no logging parameter is specified, it defaults to this value. If no awslogs log driver is configured in the task definition, the output won't be logged.

  • OVERRIDE: Specify the logging details as a part of logConfiguration. If the OVERRIDE logging option is specified, the logConfiguration is required.

clusters[].configuration.managed_storage_configuration

The details of the managed storage configuration.

Show child fields
clusters[].configuration.managed_storage_configuration.fargate_ephemeral_storage_kms_key_id

Specify the Key Management Service key ID for the Fargate ephemeral storage.

clusters[].configuration.managed_storage_configuration.kms_key_id

Specify a Key Management Service key ID to encrypt the managed storage.

clusters[].default_capacity_provider_strategy[]
Show child fields
clusters[].default_capacity_provider_strategy[].base

The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.

clusters[].default_capacity_provider_strategy[].capacity_provider

The short name of the capacity provider.

clusters[].default_capacity_provider_strategy[].weight

The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.

If no weight value is specified, the default value of 0 is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of 0 can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of 0, any RunTask or CreateService actions using the capacity provider strategy will fail.

An example scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of 1, then when the base is satisfied, the tasks will be split evenly across the two capacity providers. Using that same logic, if you specify a weight of 1 for capacityProviderA and a weight of 4 for capacityProviderB, then for every one task that's run using capacityProviderA, four tasks would use capacityProviderB.

clusters[].pending_tasks_count

The number of tasks in the cluster that are in the PENDING state.

clusters[].registered_container_instances_count

The number of container instances registered into the cluster. This includes container instances in both ACTIVE and DRAINING status.

clusters[].running_tasks_count

The number of tasks in the cluster that are in the RUNNING state.

clusters[].service_connect_defaults

Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the enabled parameter to true in the ServiceConnectConfiguration. You can set the namespace of each service individually in the ServiceConnectConfiguration to override this default parameter.

Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

Show child fields
clusters[].service_connect_defaults.namespace

The namespace name or full Amazon Resource Name (ARN) of the Cloud Map namespace. When you create a service and don't specify a Service Connect configuration, this namespace is used.

clusters[].settings[]
Show child fields
clusters[].settings[].name

The name of the cluster setting. The value is containerInsights .

clusters[].settings[].value

The value to set for the cluster setting. The supported values are enabled and disabled.

If you set name to containerInsights and value to enabled, CloudWatch Container Insights will be on for the cluster, otherwise it will be off unless the containerInsights account setting is turned on. If a cluster value is specified, it will override the containerInsights value set with PutAccountSetting or PutAccountSettingDefault.

clusters[].statistics[]
Show child fields
clusters[].statistics[].name

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

clusters[].statistics[].value

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

clusters[].status

The status of the cluster. The following are the possible states that are returned.

ACTIVE

The cluster is ready to accept tasks and if applicable you can register container instances with the cluster.

PROVISIONING

The cluster has capacity providers that are associated with it and the resources needed for the capacity provider are being created.

DEPROVISIONING

The cluster has capacity providers that are associated with it and the resources needed for the capacity provider are being deleted.

FAILED

The cluster has capacity providers that are associated with it and the resources needed for the capacity provider have failed to create.

INACTIVE

The cluster has been deleted. Clusters with an INACTIVE status may remain discoverable in your account for a period of time. However, this behavior is subject to change in the future. We don't recommend that you rely on INACTIVE clusters persisting.

clusters[].tags[]
Show child fields
clusters[].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.

clusters[].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).

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.