File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed
stacks/iams-developer-roles Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ resource "aws_kms_key_policy" "lambda_cmk" {
1818
1919data "aws_iam_policy_document" "lambda_cmk" {
2020 statement {
21- sid = " Enable IAM User Permissions for s3 buckets "
21+ sid = " Enable IAM User Permissions for Lambda CMK "
2222 effect = " Allow"
2323 principals {
2424 type = " AWS"
@@ -27,4 +27,21 @@ data "aws_iam_policy_document" "lambda_cmk" {
2727 actions = [" kms:*" ]
2828 resources = [aws_kms_key . lambda_cmk . arn ]
2929 }
30+
31+ statement {
32+ sid = " AllowCloudWatchLogsUseOfTheKey"
33+ effect = " Allow"
34+ principals {
35+ type = " Service"
36+ identifiers = [" logs.${ var . region } .amazonaws.com" ]
37+ }
38+ actions = [
39+ " kms:Encrypt" ,
40+ " kms:Decrypt" ,
41+ " kms:ReEncrypt*" ,
42+ " kms:GenerateDataKey*" ,
43+ " kms:DescribeKey"
44+ ]
45+ resources = [aws_kms_key . lambda_cmk . arn ]
46+ }
3047}
Original file line number Diff line number Diff line change @@ -72,15 +72,23 @@ resource "aws_iam_policy" "api_infrastructure" {
7272 " kms:UpdateKeyDescription" ,
7373 " kms:CreateGrant" ,
7474 " kms:CreateAlias" ,
75-
75+ " kms:TagResource" ,
76+ " kms:CreateKey" ,
77+ " kms:EnableKeyRotation" ,
78+ " kms:ScheduleKeyDeletion" ,
79+ " kms:PutKeyPolicy" ,
80+ " kms:Encrypt" ,
7681
7782 # Cloudwatch permissions
7883 " logs:Describe*" ,
7984 " logs:ListTagsForResource" ,
85+ " logs:PutRetentionPolicy" ,
86+ " logs:AssociateKmsKey" ,
8087
8188 # EC2 permissions
8289 " ec2:Describe*" ,
8390 " ec2:CreateTags" ,
91+ " ec2:CreateNetworkAclEntry" ,
8492
8593 # IAM permissions (scoped to resources with specific path prefix)
8694 " iam:Get*" ,
You can’t perform that action at this time.
0 commit comments