Amazon s3 journey

Words
117
Reading
1 min
2h
Listen to this post
~1 min

I recently traced the path of a file being sent to Amazon S3. This operation involves an asynchronous function called yourFunction, which receives three inputs: the bucket name (bucketName), the object key (key), and the object content (body).

It delegates the upload to uploadToS3—another function that accepts these same parameters and returns a promise. Upon a successful upload, this promise yields the object's URL, which yourFunction then stores in the variable s3Url.

Subsequent steps depend on this URL. If it exists, the function logs it to the console. If it is missing, the upload may have failed—though the current example does not yet define any specific action for that scenario. Finally, calling yourFunction() initiates the entire process.

Amazon s3 journey | Ecency