Skip to content

Commit

Permalink
path.module workaround (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
minniux committed Aug 9, 2019
1 parent 2c8d528 commit 1a9f34c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions notify-slack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,14 @@ data "archive_file" "slack_notification_zip" {
source_dir = "${path.module}/functions/"
}

locals {
# Solution from this comment to open issue on non-relative paths # https://github.com/hashicorp/terraform/issues/8204#issuecomment-332239294

filename = substr(data.archive_file.slack_notification_zip.output_path, length(path.cwd) + 1, -1, )
// +1 for removing the "/"
}

resource "aws_lambda_function" "cd_sns_lambda" {
function_name = "cd_sns_lambda"
role = aws_iam_role.iam_for_lambda.arn
handler = "lambda-slack.lambda_handler"

filename = local.filename
source_code_hash = filebase64sha256(local.filename)
filename = "${path.module}/lambda-slack.zip"
source_code_hash = filebase64sha256("${path.module}/lambda-slack.zip")

runtime = "python2.7"
timeout = "120"
Expand Down

0 comments on commit 1a9f34c

Please sign in to comment.