AWS Boto3

Introduction

AWS SDK for Python (Boto3)
AWS SDK for Python (Boto3) Documentation


Installation

Quickstart

Install AWS SDK boto3 for Python on your current machine.

CLI
1
pip install boto3


Configuration

If you have configured AWS CLI, then you have the credentials (IAM user, region, access_key, secret_key).
boto3 will use the same credentials to call AWS APIs.

Since I have the default user and credentials, I will skip this step.


Test

Python
1
2
3
4
5
6
7
8
import boto3

# Let's use Amazon S3
s3 = boto3.resource('s3')

# Print out bucket names
for bucket in s3.buckets.all():
print(bucket.name)

The results are the same as the AWS CLI command aws s3 list