Chapter 3. Listing available Amazon S3 buckets using notebook cells

You can check which buckets you have access to by listing the buckets available to your account.

Prerequisites

Procedure

  1. Create a new notebook cell and use the s3_client to list available buckets.

    s3_client.list_buckets()
  2. You can make this list of buckets easier to read by only printing the name, instead of the full response, for example:

    for bucket in s3_client.list_buckets()[Buckets]:
        print(bucket[Name])

    This returns output similar to the following:

    my-app-asdf3-image-registry-us-east-1-wbmlcvbasdgasdgtkpt
    cf-templates-18rxuasgasgvb-us-east-1