Search code examples
amazon-web-servicesamazon-ec2aws-sdk

Getting AWS Security group rule ID


Does anyone know how to get this Security group rule ID via AWS SDK?

enter image description here

I use this

aws ec2 describe-security-groups --group-ids sg-0ad9f9694512344

but does not seem to return anything that starts with sgr-


Solution

  • Security Group Rule IDs were introduced only recently (July 2021).

    See: Easily Manage Security Group Rules with the New Security Group Rule ID | AWS News Blog

    Therefore, your SDK might need updating.

    I checked the AWS SDK for Python (boto3) and it already has describe_security_group_rules() available.

    The AWS CLI also has: describe-security-group-rules