Skip to content

Instantly share code, notes, and snippets.

@ashutoshkarna03
Created January 12, 2020 16:32
Show Gist options
  • Save ashutoshkarna03/74aac49cf0ea731f47fb0dd3c99e4643 to your computer and use it in GitHub Desktop.
Save ashutoshkarna03/74aac49cf0ea731f47fb0dd3c99e4643 to your computer and use it in GitHub Desktop.
import boto3
from pprint import pprint
import dotenv
import os
# load the environment variables
dotenv.load_dotenv()
# create boto3 client for ec2
client = boto3.client('ec2',
region_name=os.getenv('AWS_REGION'),
aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),
aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment