Skip to content

aws.ecs.describe_task_sets

Example SQL Queries

SELECT * FROM
aws.ecs.describe_task_sets
WHERE
"cluster" = 'VALUE'
AND "service" = 'VALUE';

Description

Describes the task sets in the specified cluster and service. This is used when a service uses the EXTERNAL deployment controller type. For more information, see Amazon ECS Deployment Types in the Amazon Elastic Container Service Developer Guide.

Table Definition

Column NameColumn Data Type
cluster Required Input Column

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.

VARCHAR
service Required Input Column

The short name or full Amazon Resource Name (ARN) of the service that the task sets exist in.

VARCHAR
include Input Column

Specifies whether to see the resource tags for the task set. If TAGS is specified, the tags are included in the response. If this field is omitted, tags 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_task_sets Input Column
VARCHAR[]
Show child fields
_input_task_sets[]
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.

task_sets

The list of task sets described.

STRUCT(
"id" VARCHAR,
"task_set_arn" VARCHAR,
"service_arn" VARCHAR,
"cluster_arn" VARCHAR,
"started_by" VARCHAR,
"external_id" VARCHAR,
"status" VARCHAR,
"task_definition" VARCHAR,
"computed_desired_count" BIGINT,
"pending_count" BIGINT,
"running_count" BIGINT,
"created_at" TIMESTAMP_S,
"updated_at" TIMESTAMP_S,
"launch_type" VARCHAR,
"capacity_provider_strategy" STRUCT(
"capacity_provider" VARCHAR,
"weight" BIGINT,
"base" BIGINT
)[],
"platform_version" VARCHAR,
"platform_family" VARCHAR,
"network_configuration" STRUCT(
"awsvpc_configuration" STRUCT(
"subnets" VARCHAR[],
"security_groups" VARCHAR[],
"assign_public_ip" VARCHAR
)
),
"load_balancers" STRUCT(
"target_group_arn" VARCHAR,
"load_balancer_name" VARCHAR,
"container_name" VARCHAR,
"container_port" BIGINT
)[],
"service_registries" STRUCT(
"registry_arn" VARCHAR,
"port" BIGINT,
"container_name" VARCHAR,
"container_port" BIGINT
)[],
"scale" STRUCT(
"value" DOUBLE,
"unit" VARCHAR
),
"stability_status" VARCHAR,
"stability_status_at" TIMESTAMP_S,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"fargate_ephemeral_storage" STRUCT(
"kms_key_id" VARCHAR
)
)[]
Show child fields
task_sets[]
Show child fields
task_sets[].capacity_provider_strategy[]
Show child fields
task_sets[].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.

task_sets[].capacity_provider_strategy[].capacity_provider

The short name of the capacity provider.

task_sets[].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.

task_sets[].cluster_arn

The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.

task_sets[].computed_desired_count

The computed desired count for the task set. This is calculated by multiplying the service's desiredCount by the task set's scale percentage. The result is always rounded up. For example, if the computed desired count is 1.2, it rounds up to 2 tasks.

task_sets[].created_at

The Unix timestamp for the time when the task set was created.

task_sets[].external_id

The external ID associated with the task set.

If an CodeDeploy deployment created a task set, the externalId parameter contains the CodeDeploy deployment ID.

If a task set is created for an external deployment and is associated with a service discovery registry, the externalId parameter contains the ECS_TASK_SET_EXTERNAL_ID Cloud Map attribute.

task_sets[].fargate_ephemeral_storage

The Fargate ephemeral storage settings for the task set.

Show child fields
task_sets[].fargate_ephemeral_storage.kms_key_id

Specify an Key Management Service key ID to encrypt the ephemeral storage for deployment.

task_sets[].id

The ID of the task set.

task_sets[].launch_type

The launch type the tasks in the task set are using. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide.

task_sets[].load_balancers[]
Show child fields
task_sets[].load_balancers[].container_name

The name of the container (as it appears in a container definition) to associate with the load balancer.

You need to specify the container name when configuring the target group for an Amazon ECS load balancer.

task_sets[].load_balancers[].container_port

The port on the container to associate with the load balancer. This port must correspond to a containerPort in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the hostPort of the port mapping.

task_sets[].load_balancers[].load_balancer_name

The name of the load balancer to associate with the Amazon ECS service or task set.

If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted.

task_sets[].load_balancers[].target_group_arn

The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set.

A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer.

For services using the ECS deployment controller, you can specify one or multiple target groups. For more information, see Registering multiple target groups with a service in the Amazon Elastic Container Service Developer Guide.

For services using the CODE_DEPLOY deployment controller, you're required to define two target groups for the load balancer. For more information, see Blue/green deployment with CodeDeploy in the Amazon Elastic Container Service Developer Guide.

If your service's task definition uses the awsvpc network mode, you must choose ip as the target type, not instance. Do this when creating your target groups because tasks that use the awsvpc network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type.

task_sets[].network_configuration

The network configuration for the task set.

Show child fields
task_sets[].network_configuration.awsvpc_configuration

The VPC subnets and security groups that are associated with a task.

All specified subnets and security groups must be from the same VPC.

Show child fields
task_sets[].network_configuration.awsvpc_configuration.assign_public_ip

Whether the task's elastic network interface receives a public IP address. The default value is DISABLED.

task_sets[].network_configuration.awsvpc_configuration.security_groups[]
task_sets[].network_configuration.awsvpc_configuration.subnets[]
task_sets[].pending_count

The number of tasks in the task set that are in the PENDING status during a deployment. A task in the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time or when it's restarted after being in the STOPPED state.

task_sets[].platform_family

The operating system that your tasks in the set are running on. A platform family is specified only for tasks that use the Fargate launch type.

All tasks in the set must have the same value.

task_sets[].platform_version

The Fargate platform version where the tasks in the task set are running. A platform version is only specified for tasks run on Fargate. For more information, see Fargate platform versions in the Amazon Elastic Container Service Developer Guide.

task_sets[].running_count

The number of tasks in the task set that are in the RUNNING status during a deployment. A task in the RUNNING state is running and ready for use.

task_sets[].scale

A floating-point percentage of your desired number of tasks to place and keep running in the task set.

Show child fields
task_sets[].scale.unit

The unit of measure for the scale value.

task_sets[].scale.value

The value, specified as a percent total of a service's desiredCount, to scale the task set. Accepted values are numbers between 0 and 100.

task_sets[].service_arn

The Amazon Resource Name (ARN) of the service the task set exists in.

task_sets[].service_registries[]
Show child fields
task_sets[].service_registries[].container_name

The container name value to be used for your service discovery service. It's already specified in the task definition. If the task definition that your service task specifies uses the bridge or host network mode, you must specify a containerName and containerPort combination from the task definition. If the task definition that your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a containerName and containerPort combination or a port value. However, you can't specify both.

task_sets[].service_registries[].container_port

The port value to be used for your service discovery service. It's already specified in the task definition. If the task definition your service task specifies uses the bridge or host network mode, you must specify a containerName and containerPort combination from the task definition. If the task definition your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a containerName and containerPort combination or a port value. However, you can't specify both.

task_sets[].service_registries[].port

The port value used if your service discovery service specified an SRV record. This field might be used if both the awsvpc network mode and SRV records are used.

task_sets[].service_registries[].registry_arn

The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is Cloud Map. For more information, see CreateService.

task_sets[].stability_status

The stability status. This indicates whether the task set has reached a steady state. If the following conditions are met, the task set are in STEADY_STATE:

  • The task runningCount is equal to the computedDesiredCount.

  • The pendingCount is 0.

  • There are no tasks that are running on container instances in the DRAINING status.

  • All tasks are reporting a healthy status from the load balancers, service discovery, and container health checks.

If any of those conditions aren't met, the stability status returns STABILIZING.

task_sets[].stability_status_at

The Unix timestamp for the time when the task set stability status was retrieved.

task_sets[].started_by

The tag specified when a task set is started. If an CodeDeploy deployment created the task set, the startedBy parameter is CODE_DEPLOY. If an external deployment created the task set, the startedBy field isn't used.

task_sets[].status

The status of the task set. The following describes each state.

PRIMARY

The task set is serving production traffic.

ACTIVE

The task set isn't serving production traffic.

DRAINING

The tasks in the task set are being stopped, and their corresponding targets are being deregistered from their target group.

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

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

task_sets[].task_definition

The task definition that the task set is using.

task_sets[].task_set_arn

The Amazon Resource Name (ARN) of the task set.

task_sets[].updated_at

The Unix timestamp for the time when the task set was last updated.