Skip to content

Instantly share code, notes, and snippets.

@ginokent
Last active March 14, 2019 01:40
Show Gist options
  • Save ginokent/0d726fb6e662b867786ea964bc23d3b6 to your computer and use it in GitHub Desktop.
Save ginokent/0d726fb6e662b867786ea964bc23d3b6 to your computer and use it in GitHub Desktop.
boto3 で profile 名を指定して new client
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from boto3.session import Session
session = Session(profile_name='YOUR_AWS_PROFILE_NAME')
ec2 = session.client('ec2')
ec2.describe_instances()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment