File tree Expand file tree Collapse file tree 6 files changed +16
-15
lines changed Expand file tree Collapse file tree 6 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1
- data "null_data_source" "wait_for_lambda_build" {
2
- for_each = local. lambdas
3
-
4
- inputs = {
5
- lambda_build_id = null_resource.lambda_build[each.key].id
6
- source = " ${ path . module } /lambdas/bin/${ each . key } "
7
- }
8
- }
9
-
10
1
data "archive_file" "this" {
11
- for_each = local. lambdas
2
+ depends_on = [null_resource. lambda_build ]
3
+ for_each = local. lambdas
12
4
13
5
type = " zip"
14
- source_file = data . n ull_data_source . wait_for_lambda_build [each . key ] . outputs [ " source " ]
6
+ source_file = local . n ull . lambda_binary_locations [each . key ]
15
7
output_path = " ${ path . module } /archive/${ each . key } .zip"
16
8
}
17
9
18
-
19
10
data "aws_iam_policy_document" "this" {
20
11
statement {
21
12
actions = [" sts:AssumeRole" ]
Original file line number Diff line number Diff line change
1
+ output "saw_command" {
2
+ value = " saw watch ${ module . eventbridge_debug_logger . cloudwatch_log_group_name } --expand"
3
+ }
Original file line number Diff line number Diff line change 7
7
timeout = 10
8
8
}
9
9
}
10
+
11
+ null = {
12
+ lambda_binary_exists = { for key , _ in local . lambdas : key => fileexists (" ${ path . module } /lambdas/bin/${ key } " ) }
13
+ lambda_binary_locations = { for key , _ in local . lambdas : key => " ${ path . module } /lambdas/bin/${ key } " }
14
+ }
10
15
}
Original file line number Diff line number Diff line change 1
1
output "cloudwatch_log_group_name" {
2
2
description = " Name of cloudwatch log group which holds service-specific log events."
3
- value = aws_cloudwatch_log_group. this . name
3
+ value = aws_cloudwatch_log_group. this [ " events_debug_logger " ] . name
4
4
}
Original file line number Diff line number Diff line change 1
1
resource "aws_cloudwatch_log_group" "this" {
2
- name = " /aws/lambda/${ var . name } /${ local . service_name } "
2
+ for_each = local. lambdas
3
+
4
+ name = " /aws/lambda/${ each . key } _${ local . service_name } "
3
5
retention_in_days = var. lambda_logs_retention_in_days
4
6
tags = var. tags
5
7
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ resource "null_resource" "lambda_build" {
2
2
for_each = local. lambdas
3
3
4
4
triggers = {
5
- binary_exists = fileexists ( " ${ path . module } /lambdas/bin/ ${ each . key } " )
5
+ binary_exists = local. null .lambda_binary_exists[ each.key]
6
6
7
7
main = join (" " , [
8
8
for file in fileset (" ${ path . module } /lambdas/cmd/${ each . key } " , " *.go" ) : filebase64 (" ${ path . module } /lambdas/cmd/${ each . key } /${ file } " )
You can’t perform that action at this time.
0 commit comments