Read only commands AWS

From wikieduonline
Jump to navigation Jump to search

Cost Overview (Cost Explorer)[edit]

Total cost[edit]

aws ce get-cost-and-usage \
  --time-period Start=2026-06-01,End=2026-07-01 \
  --granularity MONTHLY \
  --metrics UnblendedCost
Cost by service (key view)
aws ce get-cost-and-usage \
  --time-period Start=2026-06-01,End=2026-07-01 \
  --granularity MONTHLY \
  --metrics UnblendedCost \
  --group-by Type=DIMENSION,Key=SERVICE 

👉 This is the most important command to identify ECS-related costs such as:


ECS Clusters & Services[edit]

aws ecs list-clusters
List services in a cluster
aws ecs list-services \
  --cluster <cluster-name>
Describe service configuration
aws ecs describe-services \
  --cluster <cluster-name> \
  --services <service-name>

Task Definitions (Rightsizing)[edit]

 aws ecs describe-task-definition \
  --task-definition <task-definition>

Auto Scaling (ECS Services)[edit]

  • Scalable targets
aws application-autoscaling describe-scalable-targets \
  --service-namespace ecs
  • Scaling policies
aws application-autoscaling describe-scaling-policies \
  --service-namespace ecs

CloudWatch Logs[edit]

aws logs describe-log-groups

Amazon ECR (Container Images)[edit]

aws ecr describe-repositories
List images in a repository
aws ecr list-images \
  --repository-name <repository-name>


Load Balancers (ECS Services)[edit]

aws elbv2 describe-load-balancers

NAT Gateways (Hidden ECS Cost Driver)[edit]

aws ec2 describe-nat-gateways

See also[edit]

Advertising: