Last active
July 30, 2019 19:13
-
-
Save ruanbekker/a6deaa531848e8def5d69087361b89ce to your computer and use it in GitHub Desktop.
Basic Boto3 Code for AWS to Set the Profile Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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