-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
730 lines (632 loc) · 27.2 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
terraform {
required_version = "1.5.1"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.46.0"
}
datadog = {
source = "DataDog/datadog"
version = "~> 3.35.0"
}
http = {
source = "hashicorp/http"
version = "3.4.2"
}
}
backend "s3" {}
}
provider "aws" {
default_tags {
tags = merge(
{
env = var.environment
management = "terraform"
owner = "grants"
repo = "grants-ingest"
service = "grants-ingest"
usage = "workload"
},
var.tags
)
}
}
provider "datadog" {
validate = var.datadog_api_key != "" && var.datadog_app_key != "" ? true : false
api_key = var.datadog_api_key
app_key = var.datadog_app_key
}
data "aws_region" "current" {}
data "aws_partition" "current" {}
data "aws_caller_identity" "current" {}
locals {
lambda_binaries_base_path = coalesce(var.lambda_binaries_base_path, "${path.module}/../bin")
permissions_boundary_arn = !can(coalesce(var.permissions_boundary_policy_name)) ? null : join(":", [
"arn",
data.aws_partition.current.id,
"iam",
"",
data.aws_caller_identity.current.account_id,
"policy/${var.permissions_boundary_policy_name}"
])
datadog_extension_layer_arn = join(":", [
"arn",
data.aws_partition.current.id,
"lambda",
data.aws_region.current.name,
{ aws = "464622532012", aws-us-gov = "002406178527" }[data.aws_partition.current.id],
"layer",
format("Datadog-Extension%s", var.lambda_arch == "arm64" ? "-ARM" : ""),
var.datadog_lambda_extension_version,
])
source_data_bucket_temp_storage_path_prefix = "tmp"
}
module "this" {
source = "cloudposse/label/null"
version = "0.25.0"
enabled = var.enabled
namespace = var.namespace
tags = var.tags
}
module "s3_label" {
source = "cloudposse/label/null"
version = "0.25.0"
context = module.this.context
attributes = [
data.aws_caller_identity.current.account_id,
data.aws_region.current.name,
]
}
module "lambda_artifacts_bucket" {
source = "cloudposse/s3-bucket/aws"
version = "4.2.0"
context = module.s3_label.context
name = "lambda_artifacts"
acl = "private"
versioning_enabled = true
sse_algorithm = "AES256"
allow_ssl_requests_only = true
allow_encrypted_uploads_only = true
source_policy_documents = []
lifecycle_configuration_rules = [
{
enabled = true
id = "rule-1"
filter_and = null
abort_incomplete_multipart_upload_days = 7
transition = [{ days = null }]
expiration = { days = null }
noncurrent_version_transition = [
{
noncurrent_days = 30
storage_class = "GLACIER"
},
]
noncurrent_version_expiration = {
noncurrent_days = 90
}
}
]
}
module "grants_source_data_bucket" {
source = "cloudposse/s3-bucket/aws"
version = "4.2.0"
context = module.s3_label.context
name = "grants_source_data"
acl = "private"
versioning_enabled = true
sse_algorithm = "AES256"
allow_ssl_requests_only = true
allow_encrypted_uploads_only = true
source_policy_documents = []
lifecycle_configuration_rules = [
{
enabled = true
id = "rule-1"
filter_and = {
object_size_greater_than = null
object_size_less_than = null
prefix = null
tags = {}
}
abort_incomplete_multipart_upload_days = 1
transition = [{ days = null }]
expiration = { days = null }
noncurrent_version_transition = [
{
noncurrent_days = 30
storage_class = "GLACIER"
},
]
noncurrent_version_expiration = {
noncurrent_days = 2557 # 7 years (includes 2 leap days)
}
},
{
// Ensures "tmp/"-prefixed objects are deleted after 7 days
enabled = true
id = "temporary-storage-cleanup"
filter_and = {
object_size_greater_than = null
object_size_less_than = null
prefix = "${local.source_data_bucket_temp_storage_path_prefix}/"
tags = {}
}
abort_incomplete_multipart_upload_days = 1
transition = [{ days = null }]
expiration = { days = 7 }
noncurrent_version_transition = [{ noncurrent_days = null }]
noncurrent_version_expiration = { noncurrent_days = null }
},
]
}
module "grants_prepared_data_bucket" {
source = "cloudposse/s3-bucket/aws"
version = "4.2.0"
context = module.s3_label.context
name = "grants_prepared_data"
acl = "private"
versioning_enabled = true
sse_algorithm = "AES256"
allow_ssl_requests_only = true
allow_encrypted_uploads_only = true
source_policy_documents = []
lifecycle_configuration_rules = [
{
enabled = true
id = "rule-1"
filter_and = null
abort_incomplete_multipart_upload_days = 1
transition = [{ days = null }]
expiration = { days = null }
noncurrent_version_transition = [
{
noncurrent_days = 30
storage_class = "GLACIER"
},
]
noncurrent_version_expiration = {
noncurrent_days = 2557 # 7 years (includes 2 leap days)
}
}
]
}
module "email_delivery_bucket" {
source = "cloudposse/s3-bucket/aws"
version = "4.2.0"
context = module.s3_label.context
name = "email_delivery"
acl = "private"
versioning_enabled = true
sse_algorithm = "AES256"
allow_ssl_requests_only = true
allow_encrypted_uploads_only = false
source_policy_documents = [data.aws_iam_policy_document.ses_source_data_s3_access.json]
lifecycle_configuration_rules = [
{
enabled = true
id = "rule-1"
filter_and = null
abort_incomplete_multipart_upload_days = 1
transition = [{ days = null }]
expiration = { days = 30 }
noncurrent_version_transition = [{ noncurrent_days = null }]
noncurrent_version_expiration = { noncurrent_days = null }
}
]
}
resource "aws_scheduler_schedule_group" "default" {
count = var.eventbridge_scheduler_enabled ? 1 : 0
name = var.namespace
}
data "aws_ssm_parameter" "datadog_api_key_secret_arn" {
count = var.datadog_enabled ? 1 : 0
name = "${var.ssm_deployment_parameters_path_prefix}/datadog/api_key_secret_arn"
}
data "aws_iam_policy_document" "read_datadog_api_key_secret" {
count = var.datadog_enabled ? 1 : 0
statement {
sid = "GetDatadogAPIKeySecretValue"
effect = "Allow"
actions = ["secretsmanager:GetSecretValue"]
resources = [data.aws_ssm_parameter.datadog_api_key_secret_arn[0].value]
}
}
module "grants_prepared_dynamodb_table" {
source = "cloudposse/dynamodb/aws"
version = "0.36.0"
context = module.this.context
name = "prepareddata"
hash_key = "grant_id"
table_class = "STANDARD"
billing_mode = "PAY_PER_REQUEST"
enable_streams = true
stream_view_type = "NEW_AND_OLD_IMAGES"
enable_point_in_time_recovery = true
enable_encryption = true
}
resource "aws_dynamodb_contributor_insights" "grants_prepared_dynamodb_main" {
count = var.dynamodb_contributor_insights_enabled ? 1 : 0
table_name = module.grants_prepared_dynamodb_table.table_name
}
resource "aws_ses_receipt_rule_set" "ffis_ingest" {
rule_set_name = "${var.namespace}-ffis_ingest"
}
resource "aws_ses_active_receipt_rule_set" "active" {
count = var.ses_active_receipt_rule_set_enabled ? 1 : 0
rule_set_name = aws_ses_receipt_rule_set.ffis_ingest.rule_set_name
}
resource "aws_ses_receipt_rule" "ffis_ingest" {
name = "${var.namespace}-ffis_ingest"
rule_set_name = aws_ses_receipt_rule_set.ffis_ingest.rule_set_name
recipients = [var.ffis_ingest_email_address]
enabled = true
scan_enabled = true
tls_policy = "Require"
s3_action {
position = 1
bucket_name = module.email_delivery_bucket.bucket_id
object_key_prefix = "ses/ffis_ingest/new/"
}
depends_on = [
module.email_delivery_bucket,
]
}
resource "aws_sqs_queue" "ffis_downloads" {
name = "${var.namespace}-ffis_downloads"
delay_seconds = 0
visibility_timeout_seconds = 15 * 60
receive_wait_time_seconds = 20
message_retention_seconds = 5 * 60 * 60 * 24 # 5 days
max_message_size = 1024 # 1 KB
sqs_managed_sse_enabled = true
lifecycle {
prevent_destroy = true
}
}
data "aws_iam_policy_document" "ses_source_data_s3_access" {
statement {
sid = "AllowFFISEmailDeliveryFromSES"
principals {
type = "Service"
identifiers = ["ses.amazonaws.com"]
}
actions = [
"s3:PutObject",
]
resources = [
"arn:aws:s3:::${module.s3_label.namespace}-emaildelivery-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}/ses/*",
]
condition {
test = "StringEquals"
variable = "AWS:SourceArn"
values = [
"arn:aws:ses:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:receipt-rule-set/${var.namespace}-ffis_ingest:receipt-rule/${var.namespace}-ffis_ingest"
]
}
condition {
test = "StringEquals"
variable = "AWS:SourceAccount"
values = [
data.aws_caller_identity.current.account_id
]
}
}
}
// Lambda defaults
locals {
datadog_custom_tags = merge(
{ "git.repository_url" = var.git_repository_url, "git.commit.sha" = var.git_commit_sha },
var.datadog_lambda_custom_tags,
)
lambda_environment_variables = merge(
!var.datadog_enabled ? {} : merge(
{
DD_API_KEY_SECRET_ARN = data.aws_ssm_parameter.datadog_api_key_secret_arn[0].value
DD_APM_ENABLED = "true"
DD_CAPTURE_LAMBDA_PAYLOAD = "true"
DD_ENV = var.environment
DD_SERVERLESS_APPSEC_ENABLED = "true"
DD_SERVICE = "grants-ingest"
DD_SITE = "datadoghq.com"
DD_TAGS = join(",", sort([for k, v in local.datadog_custom_tags : "${k}:${v}"]))
DD_TRACE_ENABLED = "true"
DD_VERSION = var.version_identifier
},
var.datadog_reserved_tags, // Allow conflicting variable-defined tags to override the above defaults
),
{
TZ = "UTC"
},
// Allow conflicting variable-defined environment variables the override of the above
var.additional_lambda_environment_variables,
)
lambda_execution_policies = compact([
try(data.aws_iam_policy_document.read_datadog_api_key_secret[0].json, ""),
])
lambda_layer_arns = compact([
var.datadog_enabled ? local.datadog_extension_layer_arn : "",
])
}
resource "aws_s3_bucket_notification" "grant_source_data" {
bucket = module.grants_source_data_bucket.bucket_id
lambda_function {
lambda_function_arn = module.ExtractGrantsGovDBToXML.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_prefix = "sources/"
filter_suffix = "/grants.gov/archive.zip"
}
lambda_function {
lambda_function_arn = module.SplitGrantsGovXMLDB.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_prefix = "sources/"
filter_suffix = "/grants.gov/extract.xml"
}
lambda_function {
lambda_function_arn = module.EnqueueFFISDownload.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_prefix = "sources/"
filter_suffix = "/ffis.org/raw.eml"
}
lambda_function {
lambda_function_arn = module.SplitFFISSpreadsheet.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_prefix = "sources/"
filter_suffix = "/ffis.org/download.xlsx"
}
depends_on = [
module.grants_source_data_bucket,
module.ExtractGrantsGovDBToXML,
module.SplitGrantsGovXMLDB,
module.EnqueueFFISDownload,
module.SplitFFISSpreadsheet,
]
}
resource "aws_s3_bucket_notification" "grant_prepared_data" {
bucket = module.grants_prepared_data_bucket.bucket_id
lambda_function {
lambda_function_arn = module.PersistGrantsGovXMLDB.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_suffix = "/grants.gov/v2.xml"
}
lambda_function {
lambda_function_arn = module.PersistGrantsGovXMLDB.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_suffix = "/grants.gov/v2.OpportunitySynopsisDetail_1_0.xml"
}
lambda_function {
lambda_function_arn = module.PersistGrantsGovXMLDB.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_suffix = "/grants.gov/v2.OpportunityForecastDetail_1_0.xml"
}
lambda_function {
lambda_function_arn = module.PersistFFISData.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_suffix = "/ffis.org/v1.json"
}
depends_on = [
module.grants_prepared_data_bucket,
module.PersistGrantsGovXMLDB,
module.PersistFFISData,
]
}
resource "aws_s3_bucket_notification" "email_delivery" {
bucket = module.email_delivery_bucket.bucket_id
lambda_function {
lambda_function_arn = module.ReceiveFFISEmail.lambda_function_arn
events = ["s3:ObjectCreated:*"]
filter_prefix = one(aws_ses_receipt_rule.ffis_ingest.s3_action).object_key_prefix
}
depends_on = [
module.email_delivery_bucket,
module.ReceiveFFISEmail,
]
}
// Modules providing Lambda functions
module "DownloadGrantsGovDB" {
source = "./modules/DownloadGrantsGovDB"
namespace = var.namespace
function_name = "DownloadGrantsGovDB"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
scheduler_group_name = try(aws_scheduler_schedule_group.default[0].name, "")
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
eventbridge_scheduler_enabled = var.eventbridge_scheduler_enabled
}
module "SplitGrantsGovXMLDB" {
source = "./modules/SplitGrantsGovXMLDB"
namespace = var.namespace
function_name = "SplitGrantsGovXMLDB"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
grants_prepared_data_bucket_name = module.grants_prepared_data_bucket.bucket_id
grants_prepared_dynamodb_table_name = module.grants_prepared_dynamodb_table.table_name
grants_prepared_dynamodb_table_arn = module.grants_prepared_dynamodb_table.table_arn
is_forecasted_grants_enabled = var.is_forecasted_grants_enabled
max_split_records = var.max_split_grantsgov_records
max_split_opportunity_records = var.max_split_grantsgov_opportunity_records
max_split_forecast_records = var.max_split_grantsgov_forecast_records
}
module "ReceiveFFISEmail" {
source = "./modules/ReceiveFFISEmail"
namespace = var.namespace
function_name = "ReceiveFFISEmail"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
email_delivery_bucket_name = one(aws_ses_receipt_rule.ffis_ingest.s3_action).bucket_name
email_delivery_object_key_prefix = one(aws_ses_receipt_rule.ffis_ingest.s3_action).object_key_prefix
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
allowed_email_senders = var.ffis_email_allowed_senders
depends_on = [
module.email_delivery_bucket,
aws_ses_receipt_rule.ffis_ingest,
module.grants_source_data_bucket,
]
}
module "EnqueueFFISDownload" {
source = "./modules/EnqueueFFISDownload"
namespace = var.namespace
function_name = "EnqueueFFISDownload"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
destination_queue_name = aws_sqs_queue.ffis_downloads.name
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
depends_on = [
module.grants_source_data_bucket,
aws_sqs_queue.ffis_downloads,
]
}
module "PersistGrantsGovXMLDB" {
source = "./modules/PersistGrantsGovXMLDB"
namespace = var.namespace
function_name = "PersistGrantsGovXMLDB"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
grants_prepared_data_bucket_name = module.grants_prepared_data_bucket.bucket_id
grants_prepared_dynamodb_table_name = module.grants_prepared_dynamodb_table.table_name
grants_prepared_dynamodb_table_arn = module.grants_prepared_dynamodb_table.table_arn
}
module "DownloadFFISSpreadsheet" {
source = "./modules/DownloadFFISSpreadsheet"
namespace = var.namespace
function_name = "DownloadFFISSpreadsheet"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
source_queue_name = aws_sqs_queue.ffis_downloads.name
download_target_bucket_name = module.grants_source_data_bucket.bucket_id
depends_on = [
module.grants_source_data_bucket,
aws_sqs_queue.ffis_downloads,
]
}
module "SplitFFISSpreadsheet" {
source = "./modules/SplitFFISSpreadsheet"
namespace = var.namespace
function_name = "SplitFFISSpreadsheet"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
grants_prepared_data_bucket_name = module.grants_prepared_data_bucket.bucket_id
depends_on = [
module.grants_source_data_bucket,
module.grants_prepared_data_bucket,
aws_sqs_queue.ffis_downloads,
]
}
module "PersistFFISData" {
source = "./modules/PersistFFISData"
namespace = var.namespace
function_name = "PersistFFISData"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
grants_prepared_data_bucket_name = module.grants_prepared_data_bucket.bucket_id
grants_prepared_dynamodb_table_name = module.grants_prepared_dynamodb_table.table_name
grants_prepared_dynamodb_table_arn = module.grants_prepared_dynamodb_table.table_arn
depends_on = [
module.grants_source_data_bucket,
]
}
module "ExtractGrantsGovDBToXML" {
source = "./modules/ExtractGrantsGovDBToXML"
namespace = var.namespace
function_name = "ExtractGrantsGovDBToXML"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
grants_source_data_bucket_name = module.grants_source_data_bucket.bucket_id
s3_temporary_path_prefix = local.source_data_bucket_temp_storage_path_prefix
depends_on = [
module.grants_source_data_bucket,
]
}
module "PublishGrantEvents" {
source = "./modules/PublishGrantEvents"
namespace = var.namespace
function_name = "PublishGrantEvents"
permissions_boundary_arn = local.permissions_boundary_arn
lambda_artifact_bucket = module.lambda_artifacts_bucket.bucket_id
log_retention_in_days = var.lambda_default_log_retention_in_days
log_level = var.lambda_default_log_level
lambda_autobuild = var.lambda_binaries_autobuild
lambda_binaries_base_path = local.lambda_binaries_base_path
lambda_arch = var.lambda_arch
additional_environment_variables = local.lambda_environment_variables
additional_lambda_execution_policy_documents = local.lambda_execution_policies
lambda_layer_arns = local.lambda_layer_arns
dynamodb_table_name = module.grants_prepared_dynamodb_table.table_name
depends_on = [
module.grants_prepared_dynamodb_table
]
}