Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Feb 12, 2024
1 parent 7775a05 commit abaed8d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion s3-config-org/kms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,32 @@ data "aws_iam_policy_document" "key" {
identifiers = [local.kms_admin_root]
}
}
statement {
sid = "KMSDescribeKeyFromServices"
effect = "Allow"
actions = [
"kms:Describe*",
"kms:List*",
]
resources = ["*"]
principals {
type = "service"
identifiers = [
"sqs.amazonaws.com",
"cloudtrail.amazonaws.com",
"sns.amazonaws.com",
"s3.amazonaws.com",
]
}
}
statement {
sid = "AWSConfigKMSPolicy"
effect = "Allow"
actions = [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey",
"kms:ReEncrypt",
]
principals {
type = "Service"
Expand All @@ -87,11 +107,13 @@ data "aws_iam_policy_document" "key" {
effect = "Allow"
actions = [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey",
"kms:ReEncrypt",
]
principals {
type = "Service"
identifiers = ["sns.amazonaws.com"]
identifiers = ["sns.amazonaws.com", "s3.amazonaws.com"]
}
resources = ["*"]
condition {
Expand Down
2 changes: 1 addition & 1 deletion s3-config-org/sqs.s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ data "aws_iam_policy_document" "config_org_s3_sqs" {
condition {
test = "StringEquals"
variable = "aws:SourceArn"
values = [var.enable_s3_sns ? aws_sns_topic.config_org_s3[0].arn : ""]
values = [var.enable_s3_sns ? aws_s3_bucket.config_org.arn : ""]
}
}
}
Expand Down

0 comments on commit abaed8d

Please sign in to comment.