# Steps to create a lambda python package ## Create layer cd layers pip install dnspython -t python/lib/python3.12/site-packages/ Then in terraform, create an archive for the layer ```hcl data "archive_file" "dnspython" { source_dir = "layers" type = "zip" output_path = "layer-dnspython.zip" } resource "aws_lambda_layer_version" "dnspython" { description = "Python3 DnsPython library" depends_on = [data.archive_file.layer1] filename = "layer-dnspython.zip" layer_name = "Python3DnsLibrary" license_info = "ISCL" compatible_architectures = ["arm64", "x86_64"] compatible_runtimes = ["python3.12"] } # In the lambda function, reference the layer resource "aws_lambda_function" "myFunction" { ... layers = [aws_lambda_layer_version.libraries.arn] } ```