Skip to content

Commit

Permalink
fix lambda role condition
Browse files Browse the repository at this point in the history
  • Loading branch information
timburke-hackit committed Oct 31, 2023
1 parent ba7365d commit d39b2a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion terraform/modules/aws-lambda/02-inputs-optional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ variable "install_requirements" {
variable "lambda_role_arn" {
type = string
description = "ARN of the IAM Role to use for the Lambda Function"
default = ""
default = null
}
2 changes: 1 addition & 1 deletion terraform/modules/aws-lambda/30-lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {

resource "aws_lambda_function" "lambda" {
function_name = lower("${var.identifier_prefix}-${var.lambda_name}")
role = var.lambda_role_arn ? var.lambda_role_arn : aws_iam_role.lambda.arn
role = var.lambda_role_arn == null ? aws_iam_role.lambda.arn : aws_iam_role.lambda.arnvar.lambda_role_arn
handler = var.handler
runtime = var.runtime
source_code_hash = data.archive_file.lambda.output_base64sha256
Expand Down

0 comments on commit d39b2a1

Please sign in to comment.