From ac21d5e733e7e63726f01f32fe71d88fcd008585 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Sun, 3 Oct 2021 14:37:09 -0400 Subject: [PATCH] Update output so the ARN can't be accessed until the function creation is complete (all permissions applied) --- outputs.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 2890a47..57051f0 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,5 @@ output "invicton_labs_lambda_shell_arn" { description = "The ARN of the Lambda function. The output is oddly named because it's used to ensure that the correct module is passed into the lambda-shell-resource and lambda-shell-data modules." - value = module.shell_lambda.lambda.arn + // Use the "complete" output of the inner Lambda module so that the function ARN can't be used until everything has been completed (permissions have been applied) + value = module.shell_lambda.complete ? module.shell_lambda.lambda.arn : module.shell_lambda.lambda.arn }