Get startedGet started for free

S3 bucket creation

Amazon's ARNs or Amazon Resource Names for buckets follow a specific format. Let's practice generating ARNs for various S3 buckets.

The S3 client has been created and stored in the s3 variable.

This exercise is part of the course

Streaming Data with AWS Kinesis and Lambda

View Course

Exercise instructions

  • Create the new "sd-vehicle-data" bucket.
  • List the buckets available in S3.
  • Generate the ARN for each bucket and print it. Remember that S3 ARNs follow the format of "arn:aws:s3:::BUCKET_NAME".

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create the new sd-vehicle-data bucket
s3.____(Bucket='sd-vehicle-data')

# List the buckets in S3
for bucket_info in s3.____()['Buckets']:
    
    # Get the bucket_name
    bucket_name = bucket_info['Name']
    
    # Generate bucket ARN.
    arn = "____:____:____:::{}".format(bucket_name)
    
    # Print the ARN
    print(arn)
Edit and Run Code