Complete the code to create a new bucket in S3.
s3_client.create_bucket(Bucket=[1])The bucket name must be a string in quotes when creating a new S3 bucket.
Complete the code to upload a file to Azure Blob Storage.
blob_client.upload_blob([1], overwrite=True)
The upload_blob method requires the data content to upload, not the file path or names.
Fix the error in the code to list blobs in an Azure container.
blobs_list = container_client.[1]()The correct method to list blobs is list_blobs(). Other options are invalid method names.
Fill both blanks to configure S3 bucket policy for public read access.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "[1]",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::[2]/*"
}]
}To allow public read access, the Effect must be 'Allow' and the Resource must specify the correct bucket name.
Fill all three blanks to generate a presigned URL for an S3 object.
url = s3_client.generate_presigned_url( ClientMethod='[1]', Params={'Bucket': '[2]', 'Key': '[3]'}, ExpiresIn=3600 )
The ClientMethod for generating a presigned URL to download is 'get_object'. The Params must include the bucket and the object key.