File tree Expand file tree Collapse file tree 4 files changed +27
-13
lines changed
Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments