MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Streaming Data with AWS Kinesis and Lambda

Lihat Kursus

Petunjuk latihan

  • 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".

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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 dan Jalankan Kode