Skip to content

Commit

Permalink
🏗️ Layer build script fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
asaf-kali committed Oct 28, 2024
1 parent dc5267f commit 5f66fc8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/build_layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ image_name="public.ecr.aws/sam/build-python3.11"
export_folder=".deployment/layer-dependencies/python"
update_pip_cmd="pip install --upgrade pip"
install_dependencies_cmd="pip install -r requirements.lock -t ${export_folder}"
docker_cmd="${update_pip_cmd}; ${install_dependencies_cmd}; exit"
rm_export_cmd="rm -rf ${export_folder}"
docker_cmd="${update_pip_cmd}; ${rm_export_cmd}; ${install_dependencies_cmd}; exit"

sudo rm -rf "$export_folder"
make lock-export || exit 1
docker run -v "$PWD":/var/task "$image_name" /bin/sh -c "$docker_cmd"
19 changes: 19 additions & 0 deletions tf/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions tf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ update:
plan:
terraform workspace select $(WORKSPACE)
terraform plan \
-out $(TERRAFORM_PLAN_FILE) \
-var-file="$(WORKSPACE).tfvars" \
-var="aws_region=$(AWS_REGION)"
-out $(TERRAFORM_PLAN_FILE) \
-var-file="$(WORKSPACE).tfvars" \
-var="aws_region=$(AWS_REGION)"

refresh:
terraform workspace select $(WORKSPACE)
terraform refresh \
-var-file="$(WORKSPACE).tfvars" \

apply:
terraform apply $(TERRAFORM_PLAN_FILE)
Expand Down
4 changes: 0 additions & 4 deletions tf/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ module "lambda_archive" {
]
}

output "lambda_archive_hash" {
value = filebase64sha256(module.lambda_archive.output_path)
}

resource "aws_lambda_function" "service_lambda" {
function_name = "${local.service_name}-lambda"
role = aws_iam_role.lambda_exec_role.arn
Expand Down

0 comments on commit 5f66fc8

Please sign in to comment.