You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS-CLI 使用教程:如何对 Auto Scaling 组执行过滤查询?

AWS CLI describe-auto-scaling-groups 命令filters参数使用示例
  • 按ASG名称模糊匹配过滤(示例匹配名称包含prod的所有ASG)
    aws autoscaling describe-auto-scaling-groups --filters "Name=auto-scaling-group-name,Values=*prod*"
    
  • 按所属VPC ID精确匹配过滤
    aws autoscaling describe-auto-scaling-groups --filters "Name=vpc-id,Values=vpc-1234567890abcdef"
    
  • 按ASG标签匹配过滤(示例匹配标签键为project、标签值为e-commerce的所有ASG)
    aws autoscaling describe-auto-scaling-groups --filters "Name=tag:project,Values=e-commerce"
    
  • 按启动模板ID匹配过滤(示例匹配使用指定启动模板的所有ASG)
    aws autoscaling describe-auto-scaling-groups --filters "Name=launch-template-id,Values=lt-0987654321fedcba"
    
  • 同时使用多个过滤条件(示例匹配所属VPC为vpc-123456、标签env值为test的所有ASG)
    aws autoscaling describe-auto-scaling-groups --filters "Name=vpc-id,Values=vpc-123456" "Name=tag:env,Values=test"
    
  • 同个过滤条件匹配多个值(示例匹配名称包含prod或者pre的所有ASG)
    aws autoscaling describe-auto-scaling-groups --filters "Name=auto-scaling-group-name,Values=*prod* *pre*"
    

所有支持的过滤字段可以通过执行aws autoscaling describe-auto-scaling-groups help命令在本地查看官方说明。

内容的提问来源于stack exchange,提问作者bhargav joshi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.23 18:27:05