原创aws s3 lambda缩略图生成
Posted rxbook
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了原创aws s3 lambda缩略图生成相关的知识,希望对你有一定的参考价值。
https://github.com/sagidm/s3-resizer
https://medium.com/swlh/how-to-get-started-with-aws-lambda-9f2ac14d863a
https://heropy.blog/2019/07/21/resizing-images-cloudfrount-lambda/
https://s3.console.aws.amazon.com/s3/home?region=ap-northeast-2
"Version": "2012-10-17", "Statement": [ "Sid": "AddPerm", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::n-test-2/*" ]
https://ap-northeast-2.console.aws.amazon.com/lambda/home?region=ap-northeast-2#/functions
"Version": "2012-10-17", "Statement": [ "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "arn:aws:logs:*:*:*" , "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::n-test-2/*" ]
https://qzdp929f68.execute-api.ap-northeast-2.amazonaws.com/default/resize-func
<RoutingRules> <RoutingRule> <Condition> <KeyPrefixEquals/> <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> </Condition> <Redirect> <Protocol>https</Protocol> <HostName>qzdp929f68.execute-api.ap-northeast-2.amazonaws.com</HostName> <ReplaceKeyPrefixWith>default/resize-func?path=</ReplaceKeyPrefixWith> <HttpRedirectCode>307</HttpRedirectCode> </Redirect> </RoutingRule> </RoutingRules>
"queryStringParameters": "path": "300x300/pic2.jpg"
http://n-test-2.s3-website.ap-northeast-2.amazonaws.com/300x300/pic2.jpg
以上是关于原创aws s3 lambda缩略图生成的主要内容,如果未能解决你的问题,请参考以下文章
[AWS][Serverless] 无服务器Serverless 图像缩略图应用