Skip to content

Commit

Permalink
Merge pull request #77 from schubergphilis/fvb/tweaks
Browse files Browse the repository at this point in the history
fix: Fix the check on given RoleArn
  • Loading branch information
fatbasstard authored Jul 2, 2024
2 parents 45eba39 + 865d5f4 commit ab3517d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
}

module "lambda_role" {
count = length([var.role_arn]) == 0 ? 1 : 0
count = length(compact([var.role_arn])) == 0 ? 1 : 0

source = "github.com/schubergphilis/terraform-aws-mcaf-role?ref=v0.3.3"
name = join("-", compact([var.role_prefix, "LambdaRole", var.name]))
Expand Down Expand Up @@ -140,7 +140,7 @@ resource "aws_lambda_function" "default" {
memory_size = var.memory_size
publish = var.publish
reserved_concurrent_executions = var.reserved_concurrency
role = length([var.role_arn]) > 0 ? var.role_arn : module.lambda_role[0].arn
role = length(compact([var.role_arn])) > 0 ? var.role_arn : module.lambda_role[0].arn
runtime = var.runtime
s3_bucket = var.s3_bucket
s3_key = var.s3_key
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ output "qualified_arn" {
}

output "role_arn" {
value = length([var.role_arn]) > 0 ? var.role_arn : module.lambda_role[0].arn
value = length(compact([var.role_arn])) > 0 ? var.role_arn : module.lambda_role[0].arn
description = "ARN of the lambda execution role"
}

Expand Down

0 comments on commit ab3517d

Please sign in to comment.