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 551cd85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
env:
# All TF variables are define din Terraform Cloud
API_KEY_TEST_MAIL: ${{secrets.API_KEY_TEST_MAIL}}
TEST_MAIL_NAMESPACE: ${{secrets.TEST_MAIL_NAMESPACE}}
TEST_MAIL_NAMESPACE: ${{secrets.TEST_MAIL_NAMESPACE}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TFE_TOKEN: ${{ secrets.TFE_TOKEN }}
steps:
Expand Down
26 changes: 5 additions & 21 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,32 +167,16 @@ 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
sudo apt install zip
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
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 551cd85

Please sign in to comment.