You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/00-setup.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,21 @@ title: Setup
4
4
permalink: /setup/
5
5
---
6
6
7
-
# Prerequisites
7
+
##Prerequisites
8
8
9
9
In order to start to use [lambda-layer-canvas-nodejs](https://github.com/charoitel/lambda-layer-canvas-nodejs) published on [AWS Serverless Application Repository](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs), you must have your AWS account with following services available:
Once you have your AWS account ready, there are two ways to deploy [lambda-layer-canvas-nodejs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs) and make it available in your AWS Lambda console:
17
17
18
-
*Deploy through AWS Serverless Application Repository
19
-
*Deploy through AWS Lambda console
18
+
-[Deploy through AWS Serverless Application Repository](#deploy-through-aws-serverless-application-repository)
19
+
-[Deploy through AWS Lambda console](#deploy-through-aws-lambda-console)
20
20
21
-
## Deploy through AWS Serverless Application Repository
21
+
###Deploy through AWS Serverless Application Repository
22
22
23
23
1. Open https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs
24
24
2. Click **Deploy** button
@@ -28,7 +28,7 @@ Once you have your AWS account ready, there are two ways to deploy [lambda-layer
28
28
6. Deployment is started and in progress
29
29
7. Check your AWS Lambda console once the deployment is completed
30
30
31
-
## Deploy through AWS Lambda console
31
+
###Deploy through AWS Lambda console
32
32
33
33
1. Login to your AWS account and open your AWS Lambda console
34
34
2. Click **Create function** button
@@ -40,13 +40,13 @@ Once you have your AWS account ready, there are two ways to deploy [lambda-layer
40
40
8. Deployment is started and in progress
41
41
9. Check your AWS Lambda console once the deployment is completed
42
42
43
-
## Using canvas layer
43
+
###Using canvas layer
44
44
45
-
After the deployment is completed, you may refer to [[Using Canvas Layer|Using Canvas Layer]] and follow an example where a Lambda function uses the canvas layer to generate PNG graphic with colored text and circle rendered.
45
+
After the deployment is completed, you may refer to [usage example]({% link 01-use.md %}) and follow the example where a Lambda function uses the canvas layer to generate PNG graphic with colored text and circle rendered.
46
46
47
-
##Environment setup
47
+
### Setup environment to build the layer
48
48
49
-
When using nodejs-18.x in Amazon Linux, it requires glibc-2.28, meanwhile, compiling glibc-2.28 requires make-4.x or later[^1].
49
+
Alternately, you may setup your own environment to build the layer according to your specific needs. When using the layer with nodejs-18.x in Amazon Linux, it requires glibc-2.28, meanwhile, compiling glibc-2.28 requires make-4.x or later[^1].
Once your environment is ready, you may execute the build layer script, ``` build-layer.sh ```, to build the layer and deploy through the AWS Lambda console.
Copy file name to clipboardExpand all lines: docs/01-use.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ permalink: /use/
6
6
7
7
## Using canvas layer in function
8
8
9
-
Before starting to use the canvas layer, it is required to have the layer deployed through AWS Serverless Application Repository or AWS Lambda console, you may refer [Setup](/setup/) for details. Then, you may create your Lambda function using:
9
+
Before starting to use the canvas layer, it is required to have the layer deployed through AWS Serverless Application Repository or AWS Lambda console, you may refer to [setup information](/setup/) for details. Then, you may create your Lambda function using:
10
10
11
11
* AWS Lambda console editor; or
12
12
* Local tool in your machine; or
@@ -16,7 +16,7 @@ Following is an example where a Lambda function uses the canvas layer to generat
16
16
17
17
## Function structure
18
18
19
-
The setup of the function may look like the following structure. For font file, you may use any supported font file you like, in this example, we are going to use DejaVu Sans which could be originally found in Amazon Linux 2 EC2 instance.
19
+
The setup of the function may look like the following structure. For font file, you may use any supported font file you like, in this example, we are going to use DejaVu Sans[^2] which could be originally found in Amazon Linux 2 EC2 instance.
20
20
21
21
```
22
22
/var/task/
@@ -29,7 +29,7 @@ The setup of the function may look like the following structure. For font file,
29
29
30
30
## Font configuration using fonts.config
31
31
32
-
Since AWS Lambda does not appear to support even the basic fonts on its own, so we create the fonts directory at the root directory for our Lambda function with following font configuration file.
32
+
Since AWS Lambda does not appear to support even the basic fonts on its own, so we create the fonts directory at the root directory for our Lambda function with following font configuration file[^1].
33
33
34
34
```xml
35
35
<?xml version="1.0"?>
@@ -87,7 +87,7 @@ As a result, the generated PNG graphic with colored text and circle rendered may
0 commit comments