Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active July 30, 2019 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ruanbekker/a6deaa531848e8def5d69087361b89ce to your computer and use it in GitHub Desktop.
Save ruanbekker/a6deaa531848e8def5d69087361b89ce to your computer and use it in GitHub Desktop.
Basic Boto3 Code for AWS to Set the Profile Name
import boto3
# setting region, profile from credential provider
session = boto3.Session(
region_name='eu-west-1',
profile_name='aws'
)
# declare ec2
ec2 = session.client('ec2')
# get a dictionary of all the instances
response = ec2.describe_instances()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment