Skip to content

Commit

Permalink
fix: lambda-layer last modif on main.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalia committed Jan 31, 2024
1 parent 7277216 commit 717d5b7
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,26 @@ resource "aws_lambda_permission" "apigw_lambda" {


# # create zip file from requirements.txt. Triggers only when the file is updated
# resource "null_resource" "lambda_layer" {
# # triggers = {
# # requirements = filesha1(local.requirements_path)
# # }
# # the command to install python and dependencies to the machine and zips
# provisioner "local-exec" {
# command = <<EOT
# /bin/bash

# pip install virtualenv &&\
# virtualenv --python=/usr/bin/python3.8 python &&\
# source python/bin/active
# pip install -r api/requirements.txt -t python/lib/python3.8/site-pakages &&\
# ls python &&\
# wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\
# ./7zz a python.zip python/ &&\
# ./7zz l python.zip
# EOT
# }
# }
resource "null_resource" "lambda_layer" {
# triggers = {
# requirements = filesha1(local.requirements_path)
# }
# the command to install python and dependencies to the machine and zips
provisioner "local-exec" {
command = <<EOT
/bin/bash
pip install virtualenv &&\
virtualenv --python=/usr/bin/python3.8 python &&\
. python/bin/activate &&\
pip install -r api/requirements.txt -t python/lib/python3.8/site-packages &&\
ls python &&\
wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\
./7zz a python.zip python/ &&\
./7zz l python.zip
EOT
}
}
# Archive a single file.

# data "archive_file" "test_zip" {
Expand Down

0 comments on commit 717d5b7

Please sign in to comment.