Skip to content

Commit

Permalink
fix: lambda-layer test archive file
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalia committed Jan 28, 2024
1 parent 38a8ac8 commit 59c030c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,23 @@ resource "null_resource" "lambda_layer" {
provisioner "local-exec" {
command = <<EOT
/bin/bash
apt install zip
apt instal python venv
python3 -m venv test_lambda_layer #Python is the name of de layer
soure python/bin/active
pip install -r api/requirements.txt -t python/lib/python3.8/site-pakages
zip -r python.zip test_lambda_layer
#zip -r python.zip test_lambda_layer
EOT
}
}
# Archive a single file.

data "archive_file" "test_zip" {
type = "zip"
source_dir = "test_lambda_layer"
output_path = "python.zip"
depends_on = [null_resource.lambda_layer]
}

resource "aws_lambda_layer_version" "test_lambda_layer" {
filename = "python.zip"
Expand Down

0 comments on commit 59c030c

Please sign in to comment.