Skip to content

Instantly share code, notes, and snippets.

View Sumit01kr's full-sized avatar
🎯
Focusing

Sumit kumar Sumit01kr

🎯
Focusing
View GitHub Profile
@Sumit01kr
Sumit01kr / boto3_listinstances_example.py
Created October 2, 2023 13:00 — forked from mda590/boto3_listinstances_example.py
Example using boto3 to list running EC2 instances
import boto3
ec2 = boto3.resource('ec2')
def lambda_handler(event, context):
# create filter for instances in running state
filters = [
{
'Name': 'instance-state-name',
'Values': ['running']