1
0

initial commit

This commit is contained in:
xpk
2026-02-13 15:44:24 +08:00
parent 66be8224f4
commit 09ce4c881a
570 changed files with 61807 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
# LambdaPyZip
This layer uses the ```python_aws_lambda``` data source, which creates zip archives with the following inputs
- source/function.py
- source/requirements.txt
Function.py contains the lambda handler, while requirements.txt states the dependencies. This datasource will run
pip install and generate zip archives in the output directory.
+27
View File
@@ -0,0 +1,27 @@
terraform {
required_providers {
python = {
source = "ATenderholt/python"
version = "0.9.2"
}
}
}
provider "python" {
pip_command = "pip3"
}
data "python_aws_lambda" "example" {
source_dir = "source"
archive_path = "output/handler.zip"
dependencies_path = "output/dependencies.zip"
extra_args = "--only-binary=:all:"
}
output lib_sum {
value = data.python_aws_lambda.example.dependencies_base64sha256
}
output function_sum {
value = data.python_aws_lambda.example.archive_base64sha256
}
+8
View File
@@ -0,0 +1,8 @@
# reference: https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-eventbridge/
import requests
def lambda_handler(event, context):
r = requests.get('https://ipinfo.io/')
return {
"HttpResponseCode": r.status_code
}
+2
View File
@@ -0,0 +1,2 @@
dnspython==2.7.0
requests