Skip to content

Dynamsoft-Ethan/DBR-python-ServerlessFramework-AWS-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBR-on-AWS-lambda

Learn dynamsoft barcode reader in AWS lambda with python through aws cli and serverless framework cli.

environment & prerequisites:

  1. python: 3.9
  2. lambda function: x86_64
  3. create IAM user in your AWS account
  4. aws-cli
  5. newer version of serverless framework cli is prefered

Dynamsoft barcode reader version:

dbr: 9.6.20

RUN the example with ServerlessFramework cli

configure aws credentials

aws configure

modify aws region and your profile(aws credential) in serverless.yml

#change aws region here
region: ap-east-1
# change your credential profile here
# if you are using aws cli the first time, the profile should be 'default'.
# (on mac) find all your profiles in ~/.aws/credentials
profile: ServerlessFrameworkUser

deploy to aws lambda

sls deploy

You can see the function is created on lambda in your aws region.

add dbr dependency layer

go to lambda in your aws region -> AWS Lambda -> Layers -> Create layer

configure the layer and upload /layers/dbr@9.6.20/python.zip create DBR layer

After the layer is created, please go to dbr-tester-dev-hello function. Then add DBR layer as a Custom layer. add DBR layer

test the lambda function:

sls invoke -f hello

expected tesult:

[
    "dynamsoft is awesome"
]

Run the example using the AWS console

add dbr dependency layer: go to lambda in your aws region -> AWS Lambda -> Layers -> Create layer

configure the layer and upload the python.zip file from /layers/dbr@9.6.20/python.zip create DBR layer

create lambda function copy the code from /handler.py into your function

Then add Custom layer. add DBR layer

run test expected test result:

[
  "dynamsoft is awesome"
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages