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, 2020 in AWS by akhtar
• 38,230 points
5,828 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, 2020 by MD
• 95,440 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 10, 2018 in AWS by Priyaj
• 58,090 points
2,054 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
• 58,090 points
1,421 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, 2020 in AWS by MD
• 95,440 points
13,100 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 11, 2020 in AWS by MD
• 95,440 points
3,783 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, 2020 in AWS by MD
• 95,440 points
1,861 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP