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

如何通过AWS CLI为安全组入站规则添加描述?

为AWS安全组入站规则添加描述的操作方法
  • 创建规则时直接添加描述
    在你原有的创建命令中新增--description参数即可,参数传入自定义的规则描述内容,完整示例如下:
aws ec2 authorize-security-group-ingress --group-id sg-00b417024c6afddae --protocol tcp --port 5000 --cidr 0.0.0.0/0 --description "允许公网访问TCP 5000端口服务"

注意:--description参数需要AWS CLI版本不低于1.18.106,所有AWS CLI v2稳定版本均支持该参数

  • 已创建的规则补充/修改描述
    如果你已经创建了规则需要补加描述,首先通过aws ec2 describe-security-groups --group-id sg-00b417024c6afddae命令查询到对应规则sgr-开头的安全组规则ID,再执行修改命令:
aws ec2 modify-security-group-rule --group-id sg-00b417024c6afddae --security-group-rule-id 你的安全组规则ID --security-group-rule '{"Description": "自定义的规则描述"}'

内容的提问来源于stack exchange,提问作者Dmitrij Kultasev

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.18 08:45:11