1
1
# Lambda Function
2
2
output "lambda_function_arn" {
3
3
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 , " " )
5
5
}
6
6
7
7
output "lambda_function_invoke_arn" {
8
8
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 , " " )
10
10
}
11
11
12
12
output "lambda_function_name" {
13
13
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 , " " )
15
15
}
16
16
17
17
output "lambda_function_qualified_arn" {
18
18
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 , " " )
20
20
}
21
21
22
22
output "lambda_function_version" {
23
23
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 , " " )
25
25
}
26
26
27
27
output "lambda_function_last_modified" {
28
28
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 , " " )
30
30
}
31
31
32
32
output "lambda_function_kms_key_arn" {
33
33
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 , " " )
35
35
}
36
36
37
37
output "lambda_function_source_code_hash" {
38
38
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 , " " )
40
40
}
41
41
42
42
output "lambda_function_source_code_size" {
43
43
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 , " " )
45
45
}
46
46
47
47
# Lambda Layer
48
48
output "lambda_layer_arn" {
49
49
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 , " " )
51
51
}
52
52
53
53
output "lambda_layer_layer_arn" {
54
54
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 , " " )
56
56
}
57
57
58
58
output "lambda_layer_created_date" {
59
59
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 , " " )
61
61
}
62
62
63
63
output "lambda_layer_source_code_size" {
64
64
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 , " " )
66
66
}
67
67
68
68
output "lambda_layer_version" {
69
69
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 , " " )
71
71
}
72
72
73
73
# Lambda Event Source Mapping
@@ -94,17 +94,17 @@ output "lambda_event_source_mapping_uuid" {
94
94
# IAM Role
95
95
output "lambda_role_arn" {
96
96
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 , " " )
98
98
}
99
99
100
100
output "lambda_role_name" {
101
101
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 , " " )
103
103
}
104
104
105
105
output "lambda_role_unique_id" {
106
106
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 , " " )
108
108
}
109
109
110
110
# CloudWatch Log Group
0 commit comments