Skip to content

Commit 4000a4f

Browse files
authored
Merge pull request #2 from nubank/fix/conditional-output-empty-tuple
fix(outputs): use one() for conditional resource outputs
2 parents aea8415 + eea90ce commit 4000a4f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

modules/services-common/outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ output "function_tools_secret_key" {
3636

3737
output "quarantine_invoke_role_arn" {
3838
description = "The ARN of the IAM role used by the API handler to invoke quarantined functions"
39-
value = var.enable_quarantine_vpc ? aws_iam_role.quarantine_invoke_role[0].arn : null
39+
value = one(aws_iam_role.quarantine_invoke_role[*].arn)
4040
}
4141

4242
output "quarantine_function_role_arn" {
4343
description = "The ARN of the IAM role used by quarantined Lambda functions"
44-
value = var.enable_quarantine_vpc ? aws_iam_role.quarantine_function_role[0].arn : null
44+
value = one(aws_iam_role.quarantine_function_role[*].arn)
4545
}
4646

4747
output "quarantine_lambda_security_group_id" {
4848
description = "The ID of the security group for quarantine Lambda functions"
49-
value = var.enable_quarantine_vpc ? aws_security_group.quarantine_lambda[0].id : null
49+
value = one(aws_security_group.quarantine_lambda[*].id)
5050
}

0 commit comments

Comments
 (0)