documentation

This commit is contained in:
Ahmad Saleem Z
2023-06-11 10:26:06 +02:00
committed by Thomas Krijnen
parent c3f2046491
commit 975b1c444c
+14 -7
View File
@@ -1,7 +1,9 @@
Dockerized AWS Lambda Function with Python and IfcOpenShell Dockerized AWS Lambda Function with Python and IfcOpenShell
=========================================================== ===========================================================
This repository provides a Dockerfile and sample code to help you run an AWS Lambda function written in Python and utilizing IfcOpenShell library. This guide provides a Dockerfile and sample code to help you run an AWS Lambda function written in Python and utilizing IfcOpenShell library.
> Note: This is a superficial guideline, in order to make this work for your usecase you will need a good understanding of other AWS services like SQS, S3, API Gateway etc.
Prerequisites Prerequisites
------------- -------------
@@ -11,27 +13,32 @@ Make sure you have Docker installed on your machine. You can download Docker fro
Getting Started Getting Started
--------------- ---------------
1. Clone this repository to your local machine: 1. **Clone this repository to your local machine:**
2. Customize the Lambda function code: 2. **Customize the Lambda function code:**
- Replace the sample Lambda function code in the `example_handler` directory with your own code. - Replace the sample Lambda function code in the `example_handler` directory with your own code.
- Update the import path in the Dockerfile's `CMD` instruction to match your Lambda function's handler function. - Update the import path in the Dockerfile's `CMD` instruction to match your Lambda function's handler function.
3. Install the required Python packages: 3. **Install the required Python packages:**
- Edit the `requirements.txt` file and add any additional dependencies required by your Lambda function. - Edit the `requirements.txt` file and add any additional dependencies required by your Lambda function.
4. Build the Docker image: 4. **Build the Docker image:**
```shell ```shell
$ docker build -t lambda-ifcopenshell . $ docker build -t lambda-ifcopenshell .
``` ```
5. Run the Docker container: 5. **Run the Docker container:**
```shell ```shell
$ docker run lambda-ifcopenshell $ docker run lambda-ifcopenshell
``` ```
6. **Test lambda locally**
Follow the steps in this [guide](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html)
6. Deploy to lambda
7. **Deploy to lambda**
This is beyond the scope of this example. Please refer to AWS documentation. Some tools that could be useful are - AWS CloudFormaton, AWS CDK, pulumi or terraform This is beyond the scope of this example. Please refer to AWS documentation. Some tools that could be useful are - AWS CloudFormaton, AWS CDK, pulumi or terraform