How to Describe security groups with Boto3?

0 votes

Hi Guys,

I am new to Boto3 module. I have some security groups in AWS. I want to describe those groups with the help of Boto3 module. How can I do that?

Oct 8 in AWS by akhtar
• 33,450 points
199 views

1 answer to this question.

0 votes

Hi@akhtar,

An EC2 instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) for running applications on the Amazon Web Services (AWS) infrastructure. You can connect the AWS using some python SDK as well. To describe the security group, you can use the below script.

import boto3
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
try:
    response = ec2.describe_security_groups(GroupIds=['SECURITY_GROUP_ID'])
    print(response)
except ClientError as e:
    print(e)
answered Oct 8 by MD
• 79,310 points

Related Questions In AWS

0 votes
1 answer

How to find unused Amazon EC2 security groups?

Select all and delete there you can ...READ MORE

answered Jul 9, 2018 in AWS by Priyaj
• 57,700 points
1,015 views
+1 vote
1 answer

How to authenticate session in application running on Beanstalk with boto3

The recommended way of managing credentials used ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 57,700 points
670 views
0 votes
1 answer

How to list contents of a bucket with boto3?

Hi@akhtar, You can create a session for an ...READ MORE

answered Sep 21 in AWS by MD
• 79,310 points
251 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to create a security group in AWS with Boto3?

Hi@akhtar, You can create a new security group ...READ MORE

answered Oct 10 in AWS by MD
• 79,310 points
116 views
0 votes
1 answer

How to handle exceptions with boto3?

Hi@akhtar, You can use botocore.exceptions package in your ...READ MORE

answered Sep 21 in AWS by MD
• 79,310 points
50 views