Skip to content

Commit c1597fd

Browse files
author
Eric Romrell
committed
Removed zipping and changed variable name to support compiled languages
1 parent b2bc692 commit c1597fd

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

main.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,6 @@ resource "aws_iam_role_policy_attachment" "lambda_policy_attach" {
219219
role = aws_iam_role.iam_for_lambda.name
220220
}
221221

222-
data "archive_file" "cleanup_lambda_zip" {
223-
source_dir = var.lambda_src_dir
224-
output_path = "lambda_function_payload.zip"
225-
type = "zip"
226-
}
227-
228222
# TODO: the SG fails to destroy because the lambda's ENI is still using it.
229223
resource "aws_security_group" "lambda_sg" {
230224
name = "${local.long_name}-lambda-sg"
@@ -243,8 +237,7 @@ resource "aws_security_group" "lambda_sg" {
243237
}
244238

245239
resource "aws_lambda_function" "api_lambda" {
246-
filename = data.archive_file.cleanup_lambda_zip.output_path
247-
source_code_hash = data.archive_file.cleanup_lambda_zip.output_base64sha256
240+
filename = var.lambda_zip_file
248241
function_name = local.long_name
249242
role = aws_iam_role.iam_for_lambda.arn
250243
handler = var.handler

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ variable "codedeploy_service_role_arn" {
1313
description = "ARN of the IAM Role for the CodeDeploy to use to initiate new deployments. (usually the PowerBuilder Role)"
1414
}
1515

16-
variable "lambda_src_dir" {
16+
variable "lambda_zip_file" {
1717
type = string
18-
description = "Directory that contains your lambda source code"
18+
description = "File that contains your compiled or zipped source code."
1919
}
2020

2121
variable "handler" {

0 commit comments

Comments
 (0)