Reputation: 657
Is there a way to get results of EC2 describe instances using boto3 in AWS Lambda? The output is preferably in JSON so that it can be parsed by another function. All EC2 instances in the JSON output.
Upvotes: 0
Views: 601
Reputation: 450
Does the provided describe_instances
function not do what you need?
import boto3
client = boto3.client('ec2')
client.describe_instances()
You'll find that for almost all of the tools you can access through the AWS CLI, there is a boto3 equivalent, and in many cases, boto3 offers a more refined option in addition to the expected one.
Upvotes: 2