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-
101data "archive_file" "this" {
11- for_each = local. lambdas
2+ depends_on = [null_resource. lambda_build ]
3+ for_each = local. lambdas
124
135 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 ]
157 output_path = " ${ path . module } /archive/${ each . key } .zip"
168}
179
18-
1910data "aws_iam_policy_document" "this" {
2011 statement {
2112 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 77 timeout = 10
88 }
99 }
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+ }
1015}
Original file line number Diff line number Diff line change 11output "cloudwatch_log_group_name" {
22 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
44}
Original file line number Diff line number Diff line change 11resource "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 } "
35 retention_in_days = var. lambda_logs_retention_in_days
46 tags = var. tags
57}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ resource "null_resource" "lambda_build" {
22 for_each = local. lambdas
33
44 triggers = {
5- binary_exists = fileexists ( " ${ path . module } /lambdas/bin/ ${ each . key } " )
5+ binary_exists = local. null .lambda_binary_exists[ each.key]
66
77 main = join (" " , [
88 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