Using boto3 library for fetching/interacting with aws resources viz ec2
Before running the code, make sure you have the following : boto3 installed and aws credentials configured so that it can fetch from your aws account.
Install boto3:
pip install boto3
Configure aws:
If you have awscli installed, the you can run the *aws configure* command to set the credentials
aws configure
In nix systems, you can have a AWS credential folder in : ~/.aws/credentials