0
0
AWScloud~10 mins

Uploading and downloading objects in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to upload a file to an S3 bucket using AWS CLI.

AWS
aws s3 cp myfile.txt s3://[1]/
Drag options to blanks, or click blank then click option'
Amybucket
Bmyfile.txt
Cfolder
Dbucketname
Attempts:
3 left
💡 Hint
Common Mistakes
Using the file name instead of the bucket name
Using a folder name without the bucket
2fill in blank
medium

Complete the code to download a file named report.pdf from an S3 bucket.

AWS
aws s3 cp s3://mybucket/[1] ./
Drag options to blanks, or click blank then click option'
Adata.csv
Bimage.png
Creport.pdf
Ddocument.docx
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong file name
Missing the file name after the bucket
3fill in blank
hard

Fix the error in the code to upload a file to S3 using the AWS SDK for Python (boto3).

AWS
s3_client.upload_file('data.csv', [1], 'data.csv')
Drag options to blanks, or click blank then click option'
A'mybucket'
Bmybucket
C'data.csv'
D'bucketname'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing bucket name without quotes
Passing file name instead of bucket name
4fill in blank
hard

Fill both blanks to download an object from S3 using boto3 and save it locally.

AWS
s3_client.[1](Bucket='mybucket', Key='image.png', Filename=[2])
Drag options to blanks, or click blank then click option'
Adownload_file
B'image.png'
C'local_image.png'
Dupload_file
Attempts:
3 left
💡 Hint
Common Mistakes
Using upload_file instead of download_file
Saving with the same key name without quotes
5fill in blank
hard

Fill all three blanks to upload a file to S3 with public read access using boto3.

AWS
s3_client.[1](Filename=[2], Bucket=[3], Key='public_file.txt', ExtraArgs={'ACL': 'public-read'})
Drag options to blanks, or click blank then click option'
Aupload_file
B'myfile.txt'
C'mybucket'
Ddownload_file
Attempts:
3 left
💡 Hint
Common Mistakes
Using download_file instead of upload_file
Passing variables without quotes
Missing ExtraArgs for ACL