Skip to content

Commit 7aff483

Browse files
eesa456axelkrastek1-nhs
authored andcommitted
NRL-693 add policy and clear typo
1 parent 783d545 commit 7aff483

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

terraform/account-wide-infrastructure/modules/lambda-errors-metric-alarm/iam.tf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,36 @@ resource "aws_iam_policy" "lambda-errors-topic-kms-read-write" {
2020
]
2121
})
2222
}
23+
24+
data "aws_caller_identity" "current" {}
25+
26+
data "aws_iam_policy_document" "sns_kms_key_policy" {
27+
policy_id = "CloudWatchEncryptUsingKey"
28+
29+
statement {
30+
effect = "Allow"
31+
actions = [
32+
"kms:*"
33+
]
34+
resources = ["*"]
35+
36+
principals {
37+
type = "AWS"
38+
identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
39+
}
40+
}
41+
42+
statement {
43+
effect = "Allow"
44+
actions = [
45+
"kms:Decrypt",
46+
"kms:GenerateDataKey"
47+
]
48+
resources = ["*"]
49+
50+
principals {
51+
type = "Service"
52+
identifiers = ["cloudwatch.amazonaws.com"]
53+
}
54+
}
55+
}

terraform/account-wide-infrastructure/modules/lambda-errors-metric-alarm/kms.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
resource "aws_kms_key" "lambda-errors-topic-key" {
22
description = "Lambda errors SNS topic table KMS key"
33
deletion_window_in_days = var.kms_deletion_window_in_days
4+
policy = data.aws_iam_policy_document.sns_kms_key_policy.json
45

56
}
67

tests/features/utils/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"736373009", # End of life care plan
1919
"16521000000101", # Lloyd George record folder
2020
"736366004", # Advanced Care Plan
21-
"735324008", # Treatement Escalation Plan
21+
"735324008", # Treatment Escalation Plan
2222
]
2323

2424

tests/performance/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LogReference:
2929
"861421000000109": "End of Life Care Coordination Summary",
3030
"887701000000100": "Emergency Health Care Plans",
3131
"736366004": "Advanced Care Plan",
32-
"735324008": "Treatement Escalation Plan",
32+
"735324008": "Treatment Escalation Plan",
3333
}
3434

3535

0 commit comments

Comments
 (0)