Skip to content

simplydemo/aws-signedurl-lambda

Repository files navigation

aws-signedurl-lambda

AWS Lambda for CloudFront Signed URL Generator

Git

git clone https://github.com/simplydemo/aws-signedurl-lambda.git

cd aws-signedurl-lambda

Build

npm install

npm run build

Build Image

docker build -t aws-signedurl-lambda:local -f ./cicd/docker/Dockerfile .

Run Docker

docker run --rm --platform linux/arm64 --name aws-signedurl-lambda -p 9000:8080 \
  -v ~/.aws/credentials:/root/.aws/credentials \
  -e AWS_PROFILE=<AWS_PROFILE> \
  -e AWS_REGION=<AWS_REGION> \
  -e CLOUDFRONT_DOMAIN=<CLOUDFRONT_DOMAIN> \
  -e CLOUDFRONT_KEYPAIR_PATH="<CLOUDFRONT_KEYPAIR_PATH>" \
  -e KEY_PAIR_ID="<KEY_PAIR_ID>" \
  aws-signedurl-lambda:local

# docker exec -it aws-signedurl-lambda bash

Test

aws-lambda-rieJest 를 통해 테스트를 진행할 수 있습니다.

Built-In된 AWS Based 컨테이너의 Endpoint (/2015-03-31/functions/function/invocations) 로 테스트 수행

curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"s3ObjectPath":"<S3_OBJECT_PATH>","expireDays":"3"}'

AWS 기본 이미지에서 빌드된 이미지 테스트


Jest 테스트 프레임워크를 통한 테스트 수행

jest src/test/handler.test.js

Dependencies


References

About

AWS Lambda for CloudFront Signed URL Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published