11# Lambda Function
22output "lambda_function_arn" {
33 description = " The ARN of the Lambda Function"
4- value = element ( concat ( aws_lambda_function. this . * . arn , [ " " ]), 0 )
4+ value = try ( aws_lambda_function. this [ 0 ] . arn , " " )
55}
66
77output "lambda_function_invoke_arn" {
88 description = " The Invoke ARN of the Lambda Function"
9- value = element ( concat ( aws_lambda_function. this . * . invoke_arn , [ " " ]), 0 )
9+ value = try ( aws_lambda_function. this [ 0 ] . invoke_arn , " " )
1010}
1111
1212output "lambda_function_name" {
1313 description = " The name of the Lambda Function"
14- value = element ( concat ( aws_lambda_function. this . * . function_name , [ " " ]), 0 )
14+ value = try ( aws_lambda_function. this [ 0 ] . function_name , " " )
1515}
1616
1717output "lambda_function_qualified_arn" {
1818 description = " The ARN identifying your Lambda Function Version"
19- value = element ( concat ( aws_lambda_function. this . * . qualified_arn , [ " " ]), 0 )
19+ value = try ( aws_lambda_function. this [ 0 ] . qualified_arn , " " )
2020}
2121
2222output "lambda_function_version" {
2323 description = " Latest published version of Lambda Function"
24- value = element ( concat ( aws_lambda_function. this . * . version , [ " " ]), 0 )
24+ value = try ( aws_lambda_function. this [ 0 ] . version , " " )
2525}
2626
2727output "lambda_function_last_modified" {
2828 description = " The date Lambda Function resource was last modified"
29- value = element ( concat ( aws_lambda_function. this . * . last_modified , [ " " ]), 0 )
29+ value = try ( aws_lambda_function. this [ 0 ] . last_modified , " " )
3030}
3131
3232output "lambda_function_kms_key_arn" {
3333 description = " The ARN for the KMS encryption key of Lambda Function"
34- value = element ( concat ( aws_lambda_function. this . * . kms_key_arn , [ " " ]), 0 )
34+ value = try ( aws_lambda_function. this [ 0 ] . kms_key_arn , " " )
3535}
3636
3737output "lambda_function_source_code_hash" {
3838 description = " Base64-encoded representation of raw SHA-256 sum of the zip file"
39- value = element ( concat ( aws_lambda_function. this . * . source_code_hash , [ " " ]), 0 )
39+ value = try ( aws_lambda_function. this [ 0 ] . source_code_hash , " " )
4040}
4141
4242output "lambda_function_source_code_size" {
4343 description = " The size in bytes of the function .zip file"
44- value = element ( concat ( aws_lambda_function. this . * . source_code_size , [ " " ]), 0 )
44+ value = try ( aws_lambda_function. this [ 0 ] . source_code_size , " " )
4545}
4646
4747# Lambda Layer
4848output "lambda_layer_arn" {
4949 description = " The ARN of the Lambda Layer with version"
50- value = element ( concat ( aws_lambda_layer_version. this . * . arn , [ " " ]), 0 )
50+ value = try ( aws_lambda_layer_version. this [ 0 ] . arn , " " )
5151}
5252
5353output "lambda_layer_layer_arn" {
5454 description = " The ARN of the Lambda Layer without version"
55- value = element ( concat ( aws_lambda_layer_version. this . * . layer_arn , [ " " ]), 0 )
55+ value = try ( aws_lambda_layer_version. this [ 0 ] . layer_arn , " " )
5656}
5757
5858output "lambda_layer_created_date" {
5959 description = " The date Lambda Layer resource was created"
60- value = element ( concat ( aws_lambda_layer_version. this . * . created_date , [ " " ]), 0 )
60+ value = try ( aws_lambda_layer_version. this [ 0 ] . created_date , " " )
6161}
6262
6363output "lambda_layer_source_code_size" {
6464 description = " The size in bytes of the Lambda Layer .zip file"
65- value = element ( concat ( aws_lambda_layer_version. this . * . source_code_size , [ " " ]), 0 )
65+ value = try ( aws_lambda_layer_version. this [ 0 ] . source_code_size , " " )
6666}
6767
6868output "lambda_layer_version" {
6969 description = " The Lambda Layer version"
70- value = element ( concat ( aws_lambda_layer_version. this . * . version , [ " " ]), 0 )
70+ value = try ( aws_lambda_layer_version. this [ 0 ] . version , " " )
7171}
7272
7373# Lambda Event Source Mapping
@@ -94,17 +94,17 @@ output "lambda_event_source_mapping_uuid" {
9494# IAM Role
9595output "lambda_role_arn" {
9696 description = " The ARN of the IAM role created for the Lambda Function"
97- value = element ( concat ( aws_iam_role. lambda . * . arn , [ " " ]), 0 )
97+ value = try ( aws_iam_role. lambda [ 0 ] . arn , " " )
9898}
9999
100100output "lambda_role_name" {
101101 description = " The name of the IAM role created for the Lambda Function"
102- value = element ( concat ( aws_iam_role. lambda . * . name , [ " " ]), 0 )
102+ value = try ( aws_iam_role. lambda [ 0 ] . name , " " )
103103}
104104
105105output "lambda_role_unique_id" {
106106 description = " The unique id of the IAM role created for the Lambda Function"
107- value = element ( concat ( aws_iam_role. lambda . * . unique_id , [ " " ]), 0 )
107+ value = try ( aws_iam_role. lambda [ 0 ] . unique_id , " " )
108108}
109109
110110# CloudWatch Log Group
0 commit comments