AWS S3 presigned URL
Question:
After uploading a file to the S3 bucket created with the script below, you want to generate a pre-signed URL for temporary access to the file. Which AWS CLI command should you use?
s3api create-bucket --bucket my-s3-bucket --region us-east-1
s3 cp ./local-file.txt s3://my-s3-bucket/
- aws s3 presign s3://my-s3-bucket/local-file.txt
- aws s3 generate-presigned-url --bucket my-s3-bucket --key local-file.txt --expires-in 3600
- aws s3 generate-presigned-url --bucket my-s3-bucket --object local-file.txt --expires 3600
- aws s3 pre-sign s3://my-s3-bucket/local-file.txt
Answer:
B - is the correct answer. The aws s3 generate-presigned-url command is used to generate a pre-signed URL, and the correct syntax includes --bucket, --key (or --object), and --expires-in parameters