Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix the check on given RoleArn #77

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading