{"id":21556623,"url":"https://github.com/fredlackey/lambda-s3-copy-example-node","last_synced_at":"2025-08-31T22:15:07.876Z","repository":{"id":96495045,"uuid":"278230702","full_name":"FredLackey/lambda-s3-copy-example-node","owner":"FredLackey","description":"Simple example function showing how to copy files between S3 buckets using AWS Lambda.","archived":false,"fork":false,"pushed_at":"2020-07-09T21:20:34.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T03:23:04.299Z","etag":null,"topics":["aws","aws-lambda","aws-s3","aws-s3-javascript","lambda-function","lambda-functions","nodejs","s3","s3-bucket","s3-buckets","s3-storage"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FredLackey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-09T01:19:34.000Z","updated_at":"2020-07-09T21:20:36.000Z","dependencies_parsed_at":"2023-03-16T13:45:51.388Z","dependency_job_id":null,"html_url":"https://github.com/FredLackey/lambda-s3-copy-example-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FredLackey/lambda-s3-copy-example-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredLackey%2Flambda-s3-copy-example-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredLackey%2Flambda-s3-copy-example-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredLackey%2Flambda-s3-copy-example-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredLackey%2Flambda-s3-copy-example-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FredLackey","download_url":"https://codeload.github.com/FredLackey/lambda-s3-copy-example-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredLackey%2Flambda-s3-copy-example-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273047202,"owners_count":25036312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-s3","aws-s3-javascript","lambda-function","lambda-functions","nodejs","s3","s3-bucket","s3-buckets","s3-storage"],"created_at":"2024-11-24T08:09:22.363Z","updated_at":"2025-08-31T22:15:07.860Z","avatar_url":"https://github.com/FredLackey.png","language":"JavaScript","readme":"# Copy Objects Between S3 Buckets Using AWS Lambda \u0026 NodeJS\nSimple example function showing how to copy files between S3 buckets using AWS Lambda.\n\n## Background  \nA friend needed a way to copy all S3 objects created by the Simple Email Service (SES) and copy them to a date-organized structure within a different S3 bucket.\n\n## Variables  \nThree environment variables exist:\n\n**`QUANTITY`**  \nOptional numeric to force the `getObjects` operation to limit the number of returned objects.  If not set, default from S3 is 1,000 objects.  NOT setting this may cause timeouts.\n\n**`SOURCE_BUCKET`**  \nName of the bucket to copy objects from.\n\n**`TARGET_BUCKET`**  \nName of the bucket to copy objects to.\n\n## Process  \nThe steps are as follows:\n\n1. Get a list of all objects  \n2. Loop through objects  \n3. Check if target object exists  \n4. Copy object to target if new  \n\n## Recommendation    \nIf you use this, I recommend adding a `deleteObject` from the `SOURCE_BUCKET` location to speed up additional processing later on.  Also, since no _starting_ position is possible, it is likely you will always iterate over the same 1,000 objects.\n\n## Contact Info  \nAs always, if you find this and need a hand, feel free to reach out:\n\n**Fred Lackey**  \n**fred.lackey@gmail.com**  \n**http://fredlackey.com**\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredlackey%2Flambda-s3-copy-example-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredlackey%2Flambda-s3-copy-example-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredlackey%2Flambda-s3-copy-example-node/lists"}