Skip to content

Commit

Permalink
fix: lamda-layer/ var.tf modifie
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalia committed Jan 28, 2024
1 parent e272bed commit 96a0670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
25 changes: 4 additions & 21 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,32 +167,15 @@ resource "null_resource" "lambda_layer" {
provisioner "local-exec" {
command = <<EOT
/bin/bash
container_name=lambda_docker
docker_image=aws_lambda_builder_image
docker build --tag $container_name .
docker run -td --name=$container_name $docker_image
docker cp ./requirements.txt $container_name:/
docker exec -i $container_name /bin/bash < ./docker_install.sh
docker cp $container_name:/python.zip python.zip
docker stop $container_name
docker rm $container_name
virtualenv --python=/usr/bin/python3.8 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
EOT
}
}

# ======================================> HERE

# resource "null_resource" "test_lamdazip" {
# provisioner "local-exec" {

# command = "/bin/bash make_lambda_layer/docker_install.sh"
# }
# }

resource "aws_lambda_layer_version" "test_lambda_layer" {
filename = "python.zip"
layer_name = "test_lambda_layer"
Expand Down
2 changes: 1 addition & 1 deletion infra/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ variable "TFC_WORKSPACE_NAME" {

# ==== Anne Lise ADDS
locals {
requirements_path = "../make_lamda_layer/requirements.txt"
requirements_path = "api/requirements.txt"
}
# variable "container_name" {
# default = "lambda_docker"
Expand Down

0 comments on commit 96a0670

Please sign in to comment.