Skip to content

Instantly share code, notes, and snippets.

View ivica-k's full-sized avatar

Ivica Kolenkaš ivica-k

View GitHub Profile
@ivica-k
ivica-k / henis.py
Created November 29, 2021 20:11
List ENIs and HENIs used by Lambdas and other AWS services
# Originally developed by Jiten P. of AWS Support
# adapted by ivica-k
import boto3
import argparse
COUNT_ENIS = 0
COUNT_HENIS = 0
COUNT_HENIS_LAMBDA = 0
@ivica-k
ivica-k / list_enis_aws_cli.sh
Created November 29, 2021 20:07
Lists ENIs used by Lambdas
# be sure to export $AWS_DEFAULT_REGION and $VPC_ID
$ aws ec2 describe-network-interfaces --region $AWS_DEFAULT_REGION \
--filters 'Name=vpc-id,Values=$VPC_ID' 'Name=status,Values=in-use' \
--query 'NetworkInterfaces[?InterfaceType==`lambda`].NetworkInterfaceId'
@ivica-k
ivica-k / henis.sh
Last active November 29, 2021 20:14
Lists ENIs and HENIs used by Lambdas
$ python henis.py
Total number of ENIs: 409
Total number of hyperplane ENIs: 139
Total number of hyperplane ENIs used by Lambdas: 68
# adding --verbose shows ENI and HENI IDs
$ python henis.py --verbose
Total number of ENIs: 413
Total number of hyperplane ENIs: 139
Total number of hyperplane ENIs used by Lambdas: 68