Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Guide to creating an AWS Lambda function in Pyt...

nk
December 22, 2024
9

Guide to creating an AWS Lambda function in Python with DuckDB

人生初英語でLTしてみました。
内容はDuckdbを使用できるAWS Lambda関数(Python)を作成してみた...です。

nk

December 22, 2024
Tweet

Transcript

  1. Self-Introduction Name:Nk(えぬけー) Job Title:Digital Transformation Promotion? (Excel Data Transfer Automation…just

    like that…) Hobby:Playing guitar X(Twitter):@NkEnuke The article URL for today's presentation is as follows↓ https://zenn.dev/amana/articles/7651ec03bb6c3e
  2. Overview 1.Why AWS Lambda with DuckDB Now 2.Creating Lambda Layer(Including

    duckdb) 3.Uploading zipfile to Lambda Layer 4.Create and Execute the Lambda Function
  3. Why AWS Lambda with DuckDB Now I had heard about

    examples of using DuckDB with AWS Lambda to perform SQL operations on S3. (Instead of AWS Athena) However, there is no article using Lambda function in Python with duckdb.
  4. #Premise ・The AWS Lambda function  has permissions  to access CSV

    data on S3. ・S3 has been set on Lambda   as a trigger. ・The Lambda settings are →
  5. Creating Lambda Layer(Including duckdb) 1.Making directory on Local mkdir python

    2.pip install duckdb with this option pip install -t python --platform manylinux2014_x86_64 --only-binary=:all: duckdb 3.Zip it for Lambda Layer zip -r layer.zip python
  6. Summary 1.Instead of AWS Athena,we can use Lambda with duckdb.(Lower

    price) 2.When you create Lambda Layer with duckdb,you have to set some option on installing. 3.Lambda function need some code.(But 8 lines!)