Skip to content

Commit 0a6f3cc

Browse files
authored
Merge pull request #122 from NHSDigital/feature/CCM-11163_inline-lambda-policies
CCM-12224: inline standard lambda policies to reduce policy resource usage
2 parents 4187e09 + 9ce14de commit 0a6f3cc

9 files changed

Lines changed: 19 additions & 35 deletions

infrastructure/modules/lambda/iam_policy_publish.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

infrastructure/modules/lambda/iam_policy_put_logs.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

infrastructure/modules/lambda/iam_policy_send_message.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

infrastructure/modules/lambda/iam_role_policy_attachment_publish.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

infrastructure/modules/lambda/iam_role_policy_attachment_put_logs.tf

Lines changed: 0 additions & 4 deletions
This file was deleted.

infrastructure/modules/lambda/iam_role_policy_attachment_send_message.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_iam_role_policy" "publish" {
2+
count = var.enable_dlq_and_notifications ? 1 : 0
3+
4+
name = "${local.csi}-publish"
5+
role = aws_iam_role.main.id
6+
policy = data.aws_iam_policy_document.publish[0].json
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resource "aws_iam_role_policy" "put_logs" {
2+
name = "${local.csi}-put-logs"
3+
role = aws_iam_role.main.id
4+
policy = data.aws_iam_policy_document.put_logs.json
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_iam_role_policy" "send_message" {
2+
count = var.enable_dlq_and_notifications ? 1 : 0
3+
4+
name = "${local.csi}-send-message"
5+
role = aws_iam_role.main.id
6+
policy = data.aws_iam_policy_document.send_message[0].json
7+
}

0 commit comments

Comments
 (0)