Skip to content

Commit

Permalink
fix: use absolute path to lambda.zip
Browse files Browse the repository at this point in the history
filebase64sha256 is unable to find "lib/lambda.zip" when using this
module from another module because the relative path doesn't resolve
to the right place in that context.

This changes both references to lambda.zip to use the absolute path by
prefixing it with `path.module`.
  • Loading branch information
jbrechtel committed Nov 30, 2022
1 parent 882c5ab commit 5b0ec40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/custom_identity_provider/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ resource "aws_lambda_function" "this_lambda" {
runtime = "python3.9"
description = "A function to lookup and return user data from AWS Secrets Manager."
tags = var.tags
filename = "lib/lambda.zip"
source_code_hash = filebase64sha256("lib/lambda.zip")
filename = "${path.module}/lib/lambda.zip"
source_code_hash = filebase64sha256("${path.module}/lib/lambda.zip")

environment {
variables = {
Expand Down

0 comments on commit 5b0ec40

Please sign in to comment.