Skip to content

Commit a643d71

Browse files
aidenvaines-cgisidnhs
authored andcommitted
CCM-12995 Adding base eventPub Infra
1 parent cbdb33d commit a643d71

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

infrastructure/terraform/components/api/module_kms.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ data "aws_iam_policy_document" "kms" {
3131
type = "Service"
3232

3333
identifiers = [
34+
"sns.amazon.com",
3435
"logs.${var.region}.amazonaws.com",
3536
]
3637
}
@@ -46,4 +47,24 @@ data "aws_iam_policy_document" "kms" {
4647
"*",
4748
]
4849
}
50+
51+
statement {
52+
sid = "AllowEventsFromSharedInfraAccount"
53+
effect = "Allow"
54+
55+
principals {
56+
type = "AWS"
57+
identifiers = ["arn:aws:iam::${var.shared_infra_account_id}:root"]
58+
}
59+
60+
actions = [
61+
"kms:Encrypt",
62+
"kms:Decrypt",
63+
"kms:GenerateDataKey"
64+
]
65+
66+
resources = [
67+
"*",
68+
]
69+
}
4970
}

infrastructure/terraform/components/api/module_lambda_letter_updates_transformer.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module "letter_updates_transformer" {
2222
function_code_base_path = local.aws_lambda_functions_dir_path
2323
function_code_dir = "letter-updates-transformer/dist"
2424
function_include_common = true
25-
handler_function_name = "updateLetter"
25+
handler_function_name = "handler"
2626
runtime = "nodejs22.x"
2727
memory = 128
2828
timeout = 5

infrastructure/terraform/components/api/module_lambda_upsert_letter.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module "upsert_letter" {
2222
function_code_base_path = local.aws_lambda_functions_dir_path
2323
function_code_dir = "upsert-letter/dist"
2424
function_include_common = true
25-
handler_function_name = "upsertLetter"
25+
handler_function_name = "handler"
2626
runtime = "nodejs22.x"
2727
memory = 128
2828
timeout = 5

infrastructure/terraform/modules/eventsub/sns_topic_policy.tf

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,14 @@ data "aws_iam_policy_document" "sns_topic_policy" {
5050
]
5151

5252
principals {
53-
type = "Service"
54-
identifiers = ["events.amazonaws.com"]
53+
type = "AWS"
54+
identifiers = [
55+
"arn:aws:iam::${var.shared_infra_account_id}:root"
56+
]
5557
}
5658

5759
resources = [
5860
aws_sns_topic.main.arn,
5961
]
60-
61-
condition {
62-
test = "StringEquals"
63-
variable = "AWS:SourceAccount"
64-
65-
values = [
66-
var.shared_infra_account_id
67-
]
68-
}
6962
}
7063
}

0 commit comments

Comments
 (0)