How to describe EC2 instances using Boto3

0 votes

Hi Guys,

I am new to the boto3 module. I want to describe the instances available in the AWS account using boto3. How can I do that?

Oct 8, 2020 in AWS by akhtar
• 38,260 points
6,685 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 describe one or more EC2 instances as shown below.

import boto3
ec2 = boto3.client('ec2')
response = ec2.describe_instances()
print(response)
answered Oct 8, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer

How to Pass the VPC ID while creating the Ec2 instance in AWS using Python Boto3

import boto3 ec2 = boto3.resource('ec2') instance = ec2.create_instances( ...READ MORE

answered Jan 29, 2019 in AWS by Priyaj
• 58,100 points
3,435 views
+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer

How can I return XML from boto calls?

I don't think there's an officially supported ...READ MORE

answered Jul 20, 2018 in AWS by Cloud gunner
• 4,670 points
1,413 views
0 votes
1 answer

How to stop EC2 instances using Boto3?

Hi@akhtar, To change the state of an EC2 ...READ MORE

answered Oct 7, 2020 in AWS by MD
• 95,460 points
2,142 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