Skip to content

Commit 0ee9bd3

Browse files
committed
Fix terraform
1 parent 5af0e9e commit 0ee9bd3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

terraform/envs/qa/main.tf

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ provider "aws" {
3030
data "aws_caller_identity" "current" {}
3131
data "aws_region" "current" {}
3232

33-
locals {
34-
bucket_prefix = "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}"
35-
}
3633

3734
module "sqs_queues" {
3835
depends_on = [module.lambdas]
3936
source = "../../modules/sqs"
4037
resource_prefix = var.ProjectId
4138
core_sqs_consumer_lambda_name = module.lambdas.core_sqs_consumer_lambda_name
4239
}
40+
locals {
41+
bucket_prefix = "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}"
42+
queue_arns = {
43+
main = module.sqs_queues.main_queue_arn
44+
sqs = module.sqs_queues.sales_email_queue_arn
45+
}
46+
}
47+
4348

4449
module "lambda_warmer" {
4550
source = "github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=v0.1.1"
@@ -122,7 +127,7 @@ resource "aws_route53_record" "linkry" {
122127
}
123128
resource "aws_lambda_event_source_mapping" "queue_consumer" {
124129
depends_on = [module.lambdas, module.sqs_queues]
125-
for_each = toset([module.sqs_queues.main_queue_arn, module.sqs_queues.sales_email_queue_arn])
130+
for_each = local.queue_arns
126131
batch_size = 5
127132
event_source_arn = each.key
128133
function_name = module.lambdas.core_sqs_consumer_lambda_arn

0 commit comments

Comments
 (0)