Skip to content

Commit 76c74aa

Browse files
authored
Update README.md
1 parent 3750206 commit 76c74aa

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,31 @@ With this Lambda Function you will be able to add decoding features to your appl
1515
To read QR/Barcodes, we are going to be using the [Zbar library](https://github.com/mchehab/zbar), an open source software suite for reading bar codes. We are going to include Zbar and other necessary packages into Lambda Layers for our Lambda function to work.
1616
But don't worry, we have already automated this process for you, in a simple script you can run in your AWS Cloud9! Here are the steps you have to follow:
1717

18-
* Access AWS Cloud9 looking for _Cloud9_ in the service search bar.
18+
* Login into you AWS Account and access AWS Cloud9 by navigating to https://console.aws.amazon.com/cloud9control/home#/
1919

20-
![CloudShell](src/img/step-0_1.png)
21-
* Once CloudShell has initiallized, clone this repo
22-
* `git clone https://github.com/aws-samples/Barcode-QR-Decoder-Lambda.git`
20+
* Click on "Create environment"
21+
22+
* Provide a name for your environment, select an instance from the t2 or t3 family and make sure to choose "Amazon Linux 2" as platform. This guarantees the correct installation of the zbar library
23+
24+
![Cloud9Setup1](src/img/cloud9_step-1.png)
25+
26+
* We recommend to choose "AWS Systems Manager(SSM)" in the network settings as it won't require you to open any inbound port to the EC2 instance. Do not change setting in the "VPC Settings" sections unless you need to. Finally, create the environment by clicking "Create"
27+
28+
![Cloud9Setup2](src/img/cloud9_step-2.png)
29+
30+
* Once your Cloud9 environment is created, open it and create a new terminal
31+
32+
![Cloud9Setup3](src/img/cloud9_step-3.png)
33+
34+
* Now clone this repo
35+
* `git clone https://github.com/aws-samples/barcode-qr-decoder-lambda.git`
2336

2437

2538
* Run the `setup.sh` script in order to generate the needed lambda layers and code package. You must specify the bucket where you want to upload this artifacts replacing <BUCKET_NAME> with the S3 bucket name you created.
26-
* `sh Barcode-QR-Decoder-Lambda/src/code/setup.sh -b <BUCKET_NAME>`
39+
* `sh barcode-qr-decoder-lambda/src/code/setup.sh -b <BUCKET_NAME>`
2740

2841

29-
* Once the script finishes, you should see 3 new files in your S3 bucket under `BarcodeQRDecoder/qr-reader/assets/` path, the two Lambda layers containing the libraries needed (Pillow and Pyzbar) and the lambda code packaged in a .zip file
42+
* Once the script finishes, you should see 2 new files in your S3 bucket under `BarcodeQRDecoder/qr-reader/assets/` path, the Lambda layer containing the libraries needed (Pillow and Pyzbar) and the lambda code packaged in a .zip file
3043

3144
![S3Files](src/img/step-0_2.png)
3245

@@ -35,28 +48,26 @@ But don't worry, we have already automated this process for you, in a simple scr
3548
* Create a new Lambda Function.
3649
* Select Author from scratch.
3750
* Input a new name for your function
38-
* Select Python 3.7 as runtime
51+
* Select Python 3.9 as runtime
3952
* Select x86_64 as architecture
4053
* Create a new role with basic Lambda permissions
41-
* Replace the code with Python code inside `code/lambda.py`
54+
* Replace the code with Python code [available in this repository](src/code/lambda_function.py)
4255

4356
You have now created the Lambda function!
4457

4558
#### Step 4, Add Layers to your Lambda function
46-
As we mentioned before, your function needs some packages to run correctly. If you completed step 2, you should have the layers artifacts ready in your bucket!
47-
Follow these steps to create your layers:
59+
As we mentioned before, your function needs some packages to run correctly. If you completed step 2, you should have the layer artifact ready in your bucket!
60+
Follow these steps to create your layer:
4861
- Open the Layers page of the Lambda console.
4962
- Choose Create layer.
5063
- Under Layer configuration, for Name, enter a name for your layer.
5164
- (Optional) For Description, enter a description for your layer.
5265
- To upload a file from Amazon S3, choose Upload a file from Amazon S3. Then, for Amazon S3 link URL, enter the S3 URI of the artifact.
5366
- For Compatible architectures, choose x86_64.
54-
- For Compatible runtimes, choose Python 3.7.
67+
- For Compatible runtimes, choose Python 3.9.
5568
- Choose Create.
5669

57-
Repeat these steps for both artifacts created in S3.
58-
59-
Next, go to the Lambda function and in your layers section, select Add Layer. Select your layers which will be available at the Custom AWS layers dropdown.
70+
Next, go to the Lambda function and in your layers section, select Add Layer. Select your layer which will be available at the Custom AWS layers dropdown.
6071

6172
#### Step 5, Configure the permissions needed
6273
Head over to IAM and add permissions to your associated role to access your S3 Bucket.

0 commit comments

Comments
 (0)