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 in AWS by akhtar
• 33,470 points
323 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 by MD
• 79,390 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
• 57,700 points
1,125 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,650 points
402 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 in AWS by MD
• 79,390 points
45 views