Sitemap
Mr. Raph

Mr. Raph

IT Professional navigating Amazon Web Services, Google Cloud Platform and Microsoft Azure. linkedin.com/in/raphjoyce-seignon

Lambda functions and buckets

2 min read4 days ago

I created 2 S3 Buckets:

sourcebucketname
destinationbucketname

I then made a Lambda function and chose to “author from scratch”

I created a role name and made a Lambda role.

I added an event trigger and allowed for recursive incovation which would prevent failures.

Get Mr. Raph’s stories in your inbox

Join Medium for free to get updates from this writer.

I uploaded a test file into the first S3 bucket and then did some light debugging, by going to CloudWatch>Logs>

Press enter or click to view image in full size

I tried a little experiment of my own. Under S3 Bucket properties, I enabled versioning. Before doing so, when I uploaded 2 test files with the same name, the older one was replaced. I suppose I expected a “do you want to overwrite this file?” message such as in Windows. This proves why versioning and object naming is so important. You can overwrite a file without realizing it. Versioning allowed me to see the previous copy of the object:

Press enter or click to view image in full size

After deploying the function and uploaded around 20 test files, I had several CloudWatch logs to draw from and analyze the process.

I had an error from when I mistakenly placed bucket names in wrong line of code:

Press enter or click to view image in full size

I was able to also determine that in the Lamba function, I could test by naming a specific filename under Key under Object and selecting a S3 Put template!
“object”: {
“key”: “filename.file”,
“size”: 1024,

--

--

Mr. Raph
Mr. Raph

Written by Mr. Raph

IT Professional navigating Amazon Web Services, Google Cloud Platform and Microsoft Azure. linkedin.com/in/raphjoyce-seignon