{"id":21324075,"url":"https://github.com/samuraikun/image-resizer-lambda-serverless","last_synced_at":"2026-05-09T19:42:52.634Z","repository":{"id":97125656,"uuid":"365194600","full_name":"samuraikun/image-resizer-lambda-serverless","owner":"samuraikun","description":"AWS Lambda to resize image by Serverless Framework","archived":false,"fork":false,"pushed_at":"2021-05-07T11:16:04.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T12:12:58.358Z","etag":null,"topics":["docker","docker-lambda","lambda","lambda-layer","ruby","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuraikun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-07T10:16:21.000Z","updated_at":"2021-05-07T11:16:07.000Z","dependencies_parsed_at":"2023-04-04T08:30:25.584Z","dependency_job_id":null,"html_url":"https://github.com/samuraikun/image-resizer-lambda-serverless","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuraikun%2Fimage-resizer-lambda-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuraikun%2Fimage-resizer-lambda-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuraikun%2Fimage-resizer-lambda-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuraikun%2Fimage-resizer-lambda-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuraikun","download_url":"https://codeload.github.com/samuraikun/image-resizer-lambda-serverless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243802645,"owners_count":20350280,"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","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":["docker","docker-lambda","lambda","lambda-layer","ruby","serverless","serverless-framework"],"created_at":"2024-11-21T20:28:35.176Z","updated_at":"2026-05-09T19:42:47.572Z","avatar_url":"https://github.com/samuraikun.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-resizer-lambda-serverless\nAWS Lambda to resize image when upload image to specific S3 bucket.\n\n## Runtime\n- Ruby2.7\n\n## Deploy \u0026 Resource Setting\n- Serverless Framework\n\n## Setup\n\n#### required\n- Docker\n- AWS Account \u0026 AWS CLI\n\n### Add AWS credential\n\n```bash\n$ touch docker.env\n```\n\n`docker.env`\n\n```bash\nAWS_ACCESS_KEY_ID=xxx\nAWS_DEFAULT_REGION=ap-northeast-1\nAWS_SECRET_ACCESS_KEY=xxx\n```\n\n### docker-compose\n\n```bash\n$ docker-compose build\n$ docker-compose --rm run serverless sh\n\nsh-4.2# bundle config set path 'vendor/bundle'\nsh-4.2# bundle install\n```\n\n## Debug Lambda\n\n### use `bundle exec ruby` in docker-compose\nFor example, you insert `binding.irb` in `handler.rb` for debug.\n\nYou command below\n\n```bash\nsh-4.2# bundle exec ruby handler.rb\n```\n\n### docker-lambda\n- WIP\n\n## Deploy\n\n```bash\nsh-4.2# sls deploy\n\n# Remove Resources\nsh-4.2# sls remove\n```\n\n## Lambda Layer\ndeploy [`libvips`](https://github.com/libvips/libvips) to lambda layer for native extendions.\n\nuse https://github.com/customink/ruby-vips-lambda\n\n```\n$ git clone https://github.com/customink/ruby-vips-lambda.git\n$ cd ruby-vips-lambda\n$ ./bin/deploy\n```\n\n#### If you deploy to layer other region(not us-east-1)\n- change `AWS_DEFAULT_REGION` in `ruby-vips-lambda/bin/deploy`\n\n```\n#!/bin/bash\n\nset -e\n\n./bin/build\n\nexport VIPS_VERSION=$(cat share/VIPS_VERSION)\nexport LAYER_NAME=\"rubyvips${VIPS_VERSION//./}-27\"\n\n# change here\nexport AWS_REGION=${AWS_REGION:=ap-northeast-1}\n\naws lambda publish-layer-version \\\n  --region $AWS_REGION \\\n  --layer-name $LAYER_NAME \\\n  --description \"Libvips for Ruby FFI.\" \\\n  --zip-file \"fileb://share/libvips.zip\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuraikun%2Fimage-resizer-lambda-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuraikun%2Fimage-resizer-lambda-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuraikun%2Fimage-resizer-lambda-serverless/lists"}