-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
praneesha
committed
Jul 17, 2023
1 parent
68909e8
commit 0c7068c
Showing
78 changed files
with
885 additions
and
157 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
examples/aws-lambda-dynamodb-trigger/aws-lambda-dynamodb-trigger.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ballerina/io; | ||
import ballerinax/aws.lambda; | ||
|
||
@lambda:Function | ||
public function dynamoDBTrigger(lambda:Context ctx, | ||
lambda:DynamoDBEvent event) returns json { | ||
io:println(event.Records[0].dynamodb.Keys.toString()); | ||
return event.Records[0].dynamodb.Keys.toString(); | ||
} |
50 changes: 50 additions & 0 deletions
50
examples/aws-lambda-dynamodb-trigger/aws-lambda-dynamodb-trigger.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# AWS Lambda DynamoDB trigger | ||
|
||
This example creates a function, which will be executed for each entry added to a database in the DynamoDB. | ||
|
||
For more information, see the [AWS Lambda learn guide](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/). | ||
|
||
## Set up the prerequisites | ||
|
||
For instructions, see [Set up the prerequisites](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/#set-up-the-prerequisites). | ||
|
||
## Write the function | ||
|
||
Follow the steps below to write the function. | ||
|
||
1. Execute the command below to create a new Ballerina package. | ||
|
||
::: out bal_new.out ::: | ||
|
||
2. Replace the content of the generated Ballerina file with the content below. | ||
|
||
::: code aws-lambda-dynamodb-trigger.bal ::: | ||
|
||
## Build the function | ||
|
||
Execute the command below to generate the AWS Lambda artifacts. | ||
|
||
::: out bal_build.out ::: | ||
|
||
## Deploy the function | ||
|
||
Execute the AWS CLI command given by the compiler to create and publish the functions by replacing the respective AWS `$LAMBDA_ROLE_ARN`, `$REGION_ID`, and `$FUNCTION_NAME` values given in the command with your values. | ||
|
||
::: out aws_deploy.out ::: | ||
|
||
## Invoke the function | ||
|
||
Follow the instructions below to create a DynamoDB table for invoking this function. | ||
|
||
1. In the IAM Console, click the corresponding role in the list, and click **Add permissions**. | ||
2. Select **attach policies** from the drop-down menu, and add the **AWSLambdaDynamoDBExecutionRole** to the role. | ||
3. Go to [DynamoDB](https://us-west-1.console.aws.amazon.com/dynamodbv2), and from the drop-down menu at the RHS of the screen, select the **AWS region** in which you created the user and role. | ||
4. Click **Create Table**, enter a table name and a partition key, and create the table (if you already have a table created, you can skip this step). | ||
5. Click on the DynamoDB table you created, and then click the **Exports and streams** tab. | ||
6. Click **Turn on** under **DynamoDB stream details**, select **Key attributes only** for the event type, and click **Turn on stream**. | ||
8. Under the **Trigger** section, click **Create trigger**, select the `dynamoDBTrigger` from the dropdown, and click **Create trigger**. | ||
9. Click **Explore table items**, and click **Create items** under the **Items returned** section. | ||
10. Enter a value under the **Attributes** section to add an entry to the DynamoDB table to invoke the Lambda function, and click **Create item**. | ||
11. Click the **Monitor** tab of the Lambda function in the AWS Management Console, and click **View CloudWatch logs** to check the logs via CloudWatch. | ||
11. Under **Log streams** in CloudWatch, click on the topmost stream in the list and verify the object name in the logs. | ||
12. Go to the AWS Lambda function and check the logs via CloudWatch to see the object identifier in the logs. |
2 changes: 2 additions & 0 deletions
2
examples/aws-lambda-dynamodb-trigger/aws-lambda-dynamodb-trigger.metatags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: This example creates a function, which will be executed for each entry added to a database in the DynamoDB. | ||
keywords: ballerina, ballerina by example, aws lambda, dynamodb, serverless, cloud, function as a service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ aws lambda create-function --function-name dynamoDBTrigger --zip-file fileb://aws-ballerina-lambda-functions.zip --handler aws-lambda-dynamodb-trigger.dynamoDBTrigger --runtime provided --role arn:aws:iam::908363916111:role/lambda-role--layers arn:aws:lambda:us-west-1:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$ bal build | ||
Compiling source | ||
wso2/aws-lambda-dynamodb-trigger:0.1.0 | ||
|
||
Generating executable | ||
@awslambda:Function: dynamoDBTrigger | ||
|
||
Run the following command to deploy each Ballerina AWS Lambda function: | ||
aws lambda create-function --function-name $FUNCTION_NAME --zip-file fileb://<project-dir>/aws-lambda-s3-trigger/target/bin/aws-ballerina-lambda-functions.zip --handler aws-lambda-dynamodb-trigger.$FUNCTION_NAME --runtime provided --role $LAMBDA_ROLE_ARN --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 | ||
|
||
Run the following command to re-deploy an updated Ballerina AWS Lambda function: | ||
aws lambda update-function-code --function-name $FUNCTION_NAME --zip-file fileb://aws-ballerina-lambda-functions.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ bal new aws-lambda-dynamodb-trigger |
13 changes: 13 additions & 0 deletions
13
examples/aws-lambda-execution-context/aws-lambda-execution-context.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ballerinax/aws.lambda; | ||
|
||
// The `lambda:Context` object contains request execution context information. | ||
@lambda:Function | ||
public function ctxinfo(lambda:Context ctx, json input) returns json|error { | ||
return { | ||
RequestID: ctx.getRequestId(), | ||
DeadlineMS: ctx.getDeadlineMs(), | ||
InvokedFunctionArn: ctx.getInvokedFunctionArn(), | ||
TraceID: ctx.getTraceId(), | ||
RemainingExecTime: ctx.getRemainingExecutionTime() | ||
}; | ||
} |
39 changes: 39 additions & 0 deletions
39
examples/aws-lambda-execution-context/aws-lambda-execution-context.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# AWS Lambda execution context | ||
|
||
The example below demonstrates how the execution context information of an AWS function can be retrieved. | ||
|
||
For more information, see the [AWS Lambda learn guide](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/). | ||
|
||
## Set up the prerequisites | ||
|
||
For instructions, see [Set up the prerequisites](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/#set-up-the-prerequisites). | ||
|
||
## Write the function | ||
|
||
Follow the steps below to write the function. | ||
|
||
1. Execute the command below to create a new Ballerina package. | ||
|
||
::: out bal_new.out ::: | ||
|
||
2. Replace the content of the generated Ballerina file with the content below. | ||
|
||
::: code aws-lambda-execution-context.bal ::: | ||
|
||
## Build the function | ||
|
||
Execute the command below to generate the AWS Lambda artifacts. | ||
|
||
::: out bal_build.out ::: | ||
|
||
## Deploy the function | ||
|
||
Execute the AWS CLI command given by the compiler to create and publish the functions by replacing the respective AWS `$LAMBDA_ROLE_ARN`, `$REGION_ID`, and `$FUNCTION_NAME` values given in the command with your values. | ||
|
||
::: out aws_deploy.out ::: | ||
|
||
## Invoke the function | ||
|
||
Execute the commands below to invoke the function. | ||
|
||
::: out invoke_functions.out ::: |
2 changes: 2 additions & 0 deletions
2
examples/aws-lambda-execution-context/aws-lambda-execution-context.metatags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: The example below demonstrates how the execution context information of an AWS function can be retrieved. | ||
keywords: ballerina, ballerina by example, aws lambda, execution context, serverless, cloud, function as a service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ aws lambda create-function --function-name ctxinfo --zip-file fileb://aws-ballerina-lambda-functions.zip --handler aws-lambda-execution-context.ctxinfo --runtime provided --role arn:aws:iam::908363916111:role/lambda-role --layers arn:aws:lambda:us-west-1:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$ bal build | ||
Compiling source | ||
wso2/aws-lambda-execution-context:0.1.0 | ||
|
||
Generating executable | ||
@awslambda:Function: ctxinfo | ||
|
||
Run the following command to deploy each Ballerina AWS Lambda function: | ||
aws lambda create-function --function-name $FUNCTION_NAME --zip-file fileb://<project-dir>/aws-lambda-execution-context/target/bin/aws-ballerina-lambda-functions.zip --handler aws_lambda_deployment.$FUNCTION_NAME --runtime provided --role $LAMBDA_ROLE_ARN --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 | ||
|
||
Run the following command to re-deploy an updated Ballerina AWS Lambda function: | ||
aws lambda update-function-code --function-name $FUNCTION_NAME --zip-file fileb://aws-ballerina-lambda-functions.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ bal new aws-lambda-execution-context |
8 changes: 0 additions & 8 deletions
8
...ws-lambda-deployment/invoke_functions.out → ...da-execution-context/invoke_functions.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ballerina/io; | ||
import ballerinax/aws.lambda; | ||
|
||
// The `@lambda:Function` annotation marks a function to generate an AWS Lambda function. | ||
@lambda:Function | ||
public function echo(lambda:Context ctx, json input) returns json { | ||
io:println(input.toJsonString()); | ||
return input; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# AWS Lambda - Hello world | ||
|
||
This example demonstrates how to write a simple echo function in AWS Lambda. | ||
|
||
For more information, see the [AWS Lambda learn guide](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/). | ||
|
||
## Set up the prerequisites | ||
|
||
For instructions, see [Set up the prerequisites](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/#set-up-the-prerequisites). | ||
|
||
## Write the function | ||
|
||
Follow the steps below to write the function. | ||
|
||
1. Execute the command below to create a new Ballerina package. | ||
|
||
::: out bal_new.out ::: | ||
|
||
2. Replace the content of the generated Ballerina file with the content below. | ||
|
||
::: code aws-lambda-hello-world.bal ::: | ||
|
||
## Build the function | ||
|
||
Execute the command below to generate the AWS Lambda artifacts. | ||
|
||
::: out bal_build.out ::: | ||
|
||
## Deploy the function | ||
|
||
Execute the AWS CLI command given by the compiler to create and publish the functions by replacing the respective AWS `$LAMBDA_ROLE_ARN`, `$REGION_ID`, and `$FUNCTION_NAME` values given in the command with your values. | ||
|
||
::: out aws_deploy.out ::: | ||
|
||
## Invoke the function | ||
|
||
Execute the commands below to invoke the function. | ||
|
||
::: out invoke_functions.out ::: |
2 changes: 2 additions & 0 deletions
2
examples/aws-lambda-hello-world/aws-lambda-hello-world.metatags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: This example demonstrates how to write a simple echo function in AWS Lambda. | ||
keywords: ballerina, ballerina by example, serverless, aws lambda, cloud, function as a service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ aws lambda create-function --function-name echo --zip-file fileb://aws-ballerina-lambda-functions.zip --handler aws-lambda-hello-world.echo --runtime provided --role arn:aws:iam::908363916111:role/lambda-role--layers arn:aws:lambda:us-west-1:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$ bal build | ||
Compiling source | ||
wso2/aws-lambda-hello-world:0.1.0 | ||
|
||
Generating executable | ||
@awslambda:Function: echo | ||
|
||
Run the following command to deploy each Ballerina AWS Lambda function: | ||
aws lambda create-function --function-name $FUNCTION_NAME --zip-file fileb://<project-dir>/aws-lambda-hello-world/target/bin/aws-ballerina-lambda-functions.zip --handler aws-lambda-hello-world.$FUNCTION_NAME --runtime provided --role $LAMBDA_ROLE_ARN --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 | ||
|
||
Run the following command to re-deploy an updated Ballerina AWS Lambda function: | ||
aws lambda update-function-code --function-name $FUNCTION_NAME --zip-file fileb://aws-ballerina-lambda-functions.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ bal new aws-lambda-hello-world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$ echo '{"MESSAGE":"HELLO"}' > input.json | ||
$ aws lambda invoke --function-name echo --payload fileb://input.json echo-response.txt | ||
{ | ||
"ExecutedVersion": "$LATEST", | ||
"StatusCode": 200 | ||
} | ||
$ cat echo-response.txt | ||
{"MESSAGE":"HELLO"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ballerina/io; | ||
import ballerinax/aws.lambda; | ||
|
||
@lambda:Function | ||
public function s3Trigger(lambda:Context ctx, | ||
lambda:S3Event event) returns json { | ||
io:println(event.Records[0].s3.'object.key); | ||
return event.Records[0].s3.'object.key; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# AWS Lambda S3 trigger | ||
|
||
This example creates a function, which will be executed for each object creation in AWS S3. | ||
|
||
For more information, see the [AWS Lambda learn guide](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/). | ||
|
||
## Set up the prerequisites | ||
|
||
For instructions, see [Set up the prerequisites](https://ballerina.io/learn/run-in-the-cloud/function-as-a-service/aws-lambda/#set-up-the-prerequisites). | ||
|
||
## Write the function | ||
|
||
Follow the steps below to write the function. | ||
|
||
1. Execute the command below to create a new Ballerina package. | ||
|
||
::: out bal_new.out ::: | ||
|
||
2. Replace the content of the generated Ballerina file with the content below. | ||
|
||
::: code aws-lambda-s3-trigger.bal ::: | ||
|
||
## Build the function | ||
|
||
Execute the command below to generate the AWS Lambda artifacts. | ||
|
||
::: out bal_build.out ::: | ||
|
||
## Deploy the function | ||
|
||
Execute the AWS CLI command given by the compiler to create and publish the functions by replacing the respective AWS `$LAMBDA_ROLE_ARN`, `$REGION_ID`, and `$FUNCTION_NAME` values given in the command with your values. | ||
|
||
::: out aws_deploy.out ::: | ||
|
||
## Invoke the function | ||
|
||
Follow the instructions below to create an S3 bucket in AWS for invoking this function. | ||
|
||
1. Go to the [AWS S3](https://s3.console.aws.amazon.com/s3/) portal and create a bucket. | ||
>**Note:** Make sure to select the same **AWS region** in which you created the AWS user and role when creating the S3 bucket. | ||
2. Click on the created bucket, go to the **Properties** tab, and click **Create event notification** under the **Event notifications** section. | ||
3. Enable **All object create events** under event types. | ||
4. Under the **Destination** section, select the AWS Lambda function (i.e., `s3Trigger` in this example) from the dropdown. | ||
5. Select the created bucket under the **Buckets** list, click **Upload**, and upload an object to the S3 bucket. | ||
6. Under the **Functions** list of the AWS Management Console, click the AWS Lambda function, and click the **Monitor** tab. | ||
7. If you get a **Missing permissions** notice at the top, click the **Open the IAM Console** in it. | ||
8. In the IAM Console, click the corresponding role in the list, and click **Add permissions**. | ||
9. Select **attach policies** from the drop-down menu, and add the **AWSLambdaBasicExecutionRole** to the role. | ||
10. Click the **Monitor** tab of the Lambda function in the AWS Management Console, and click **View CloudWatch logs** to check the logs via CloudWatch. | ||
11. Under **Log streams** in CloudWatch, click on the topmost stream in the list and verify the object name in the logs. |
2 changes: 2 additions & 0 deletions
2
examples/aws-lambda-s3-trigger/aws-lambda-s3-trigger.metatags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: This example creates a function, which will be executed for each object creation in AWS S3. | ||
keywords: ballerina, ballerina by example, aws lambda, s3, trigger, serverless, cloud, function as a service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ aws lambda create-function --function-name s3Trigger --zip-file fileb://aws-ballerina-lambda-functions.zip --handler aws-lambda-s3-trigger.s3Trigger --runtime provided --role arn:aws:iam::908363916111:role/lambda-role--layers arn:aws:lambda:us-west-1:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 |
6 changes: 3 additions & 3 deletions
6
examples/aws-lambda-deployment/bal_build.out → examples/aws-lambda-s3-trigger/bal_build.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
$ bal build | ||
Compiling source | ||
wso2/aws_lambda_deployment:0.1.0 | ||
wso2/aws-lambda-s3-trigger:0.1.0 | ||
|
||
Generating executable | ||
@awslambda:Function: echo, ctxinfo, notifyS3 | ||
@awslambda:Function: s3Trigger | ||
|
||
Run the following command to deploy each Ballerina AWS Lambda function: | ||
aws lambda create-function --function-name $FUNCTION_NAME --zip-file fileb://<project-dir>/aws_lambda_deployment/target/bin/aws-ballerina-lambda-functions.zip --handler aws_lambda_deployment.$FUNCTION_NAME --runtime provided --role $LAMBDA_ROLE_ARN --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 | ||
aws lambda create-function --function-name $FUNCTION_NAME --zip-file fileb://<project-dir>/aws-lambda-s3-trigger/target/bin/aws-ballerina-lambda-functions.zip --handler aws-lambda-s3-trigger.$FUNCTION_NAME --runtime provided --role $LAMBDA_ROLE_ARN --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre11:6 --memory-size 512 --timeout 10 | ||
|
||
Run the following command to re-deploy an updated Ballerina AWS Lambda function: | ||
aws lambda update-function-code --function-name $FUNCTION_NAME --zip-file fileb://aws-ballerina-lambda-functions.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ bal new aws-lambda-s3-trigger |
File renamed without changes.
Oops, something went wrong.