steampipe plugin install aws

Table: aws_ecs_service - Query AWS Elastic Container Service using SQL

The AWS Elastic Container Service (ECS) is a highly scalable, high-performance container orchestration service that supports Docker containers and allows you to easily run and scale containerized applications on AWS. ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure. With simple API calls, you can launch and stop Docker-enabled applications, query the complete state of your application, and access many familiar features like security groups, Elastic Load Balancing, EBS volumes, and IAM roles.

Table Usage Guide

The aws_ecs_service table in Steampipe provides you with information about the services within the AWS Elastic Container Service (ECS) clusters. This table lets you, as a DevOps engineer, query service-specific details, including service status, task definitions, and associated metadata. You can utilize this table to gather insights on services, such as service health status, task definitions being used, and more. The schema outlines the various attributes of the ECS service for you, including the service ARN, cluster ARN, task definition, desired count, running count, and associated tags.

Examples

Basic info

Explore the status and details of various tasks within your AWS ECS service. This can help you understand the state of your tasks and identify any potential issues or anomalies.

select
service_name,
arn,
cluster_arn,
task_definition,
status
from
aws_ecs_service;
select
service_name,
arn,
cluster_arn,
task_definition,
status
from
aws_ecs_service;

List services not using the latest version of AWS Fargate platform

Determine the areas in which your services are not utilizing the latest version of the AWS Fargate platform. This can be useful in identifying outdated services that may potentially benefit from an upgrade for enhanced performance and security.

select
service_name,
arn,
launch_type,
platform_version
from
aws_ecs_service
where
launch_type = 'FARGATE'
and platform_version is not null;
select
service_name,
arn,
launch_type,
platform_version
from
aws_ecs_service
where
launch_type = 'FARGATE'
and platform_version is not null;

List inactive services

Discover the segments that are inactive within your AWS ECS services. This can be particularly useful when cleaning up or troubleshooting your environment.

select
service_name,
arn,
status
from
aws_ecs_service
where
status = 'INACTIVE';
select
service_name,
arn,
status
from
aws_ecs_service
where
status = 'INACTIVE';

Schema for aws_ecs_service

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Amazon Resource Name (ARN) specifying the service.
capacity_provider_strategyjsonbThe capacity provider strategy associated with the service.
cluster_arntextThe Amazon Resource Name (ARN) of the cluster that hosts the service.
created_attimestamp with time zoneThe date and time when the service was created.
created_bytextThe principal that created the service.
deployment_configurationjsonbOptional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
deployment_controller_typetextThe deployment controller type to use. Possible values are: ECS, CODE_DEPLOY, and EXTERNAL.
deploymentsjsonbThe current state of deployments for the service.
desired_countbigintThe desired number of instantiations of the task definition to keep running on the service.
enable_ecs_managed_tagsbooleanSpecifies whether to enable Amazon ECS managed tags for the tasks in the service.
enable_execute_commandbooleanIndicates whether or not the execute command functionality is enabled for the service.
eventsjsonbThe event stream for your service. A maximum of 100 of the latest events are displayed.
health_check_grace_period_secondsbigintThe period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
launch_typetextThe launch type on which your service is running. If no value is specified, it will default to EC2.
load_balancersjsonbA list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
network_configurationjsonbThe VPC subnet and security group configuration for tasks that receive their own elastic network interface by using the awsvpc networking mode.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
pending_countbigintThe number of tasks in the cluster that are in the PENDING state.
placement_constraintsjsonbThe placement constraints for the tasks in the service.
placement_strategyjsonbThe placement strategy that determines how tasks for the service are placed.
platform_familytextThe operating system that your tasks in the service run on.
platform_versiontextThe platform version on which to run your service.
propagate_tagstextSpecifies whether to propagate the tags from the task definition or the service to the task. If no value is specified, the tags are not propagated.
regiontextThe AWS Region in which the resource is located.
role_arntextThe ARN of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with an Elastic Load Balancing load balancer.
running_countbigintThe number of tasks in the cluster that are in the RUNNING state.
scheduling_strategytextThe scheduling strategy to use for the service.
service_nametextThe name of the service.
service_registriesjsonbThe details of the service discovery registries to assign to this service.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustextThe status of the service. Valid values are: ACTIVE, DRAINING, or INACTIVE.
tagsjsonbA map of tags for the resource.
tags_srcjsonbThe metadata that you apply to the service to help you categorize and organize them.
task_definitiontextThe task definition to use for tasks in the service.
task_setsjsonbInformation about a set of Amazon ECS tasks in either an AWS CodeDeploy or an EXTERNAL deployment.
titletextTitle of the resource.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws

You can pass the configuration to the command with the --config argument:

steampipe_export_aws --config '<your_config>' aws_ecs_service