Kom igångKom igång gratis

Your first boto3 client

Sam wants to cast off the shackles of only being able to use her computer for storage and compute. She is learning how to use the awesome power of the cloud to create data pipelines and automatically generate reports.

Before she can do all that, she needs to create her first boto3 client and check out what buckets already exist in S3.

Her AWS key and AWS secret key have been stored in AWS_KEY_ID and AWS_SECRET respectively.

In this exercise, you will help Sam by creating your first boto3 client to AWS!

Den här övningen är en del av kursen

Introduction to AWS Boto in Python

Visa kurs

Övningsinstruktioner

  • Generate a boto3 client for interacting with s3.
  • Specify 'us-east-1' for the region_name.
  • Use AWS_KEY_ID and AWS_SECRET to set up the credentials.
  • Print the buckets.

Interaktiv övning med praktiskt arbete

Testa den här övningen genom att slutföra den här exempelkoden.

# Generate the boto3 client for interacting with S3
s3 = boto3.client('____', ____='us-east-1', 
                        # Set up AWS credentials 
                        aws_access_key_id=____, 
                         aws_secret_access_key=____)
# List the buckets
buckets = s3.list_buckets()

# Print the buckets
print(buckets)
Redigera och kör kod