Skip to content

Commit

Permalink
fix: adding the fix for the topic policy (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
gambol99 authored Apr 23, 2024
1 parent b6330bd commit 5cf6b11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*.tfstate
*.tfstate.*

builds/

# Crash log files
crash.log
crash.*.log
Expand Down
3 changes: 3 additions & 0 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data "aws_region" "current" {}
## Provision an SQS IAM policy allowing the account root
data "aws_iam_policy_document" "current" {
statement {
sid = "AllowAccountRoot"
effect = "Allow"
principals {
type = "AWS"
Expand All @@ -22,6 +23,7 @@ data "aws_iam_policy_document" "current" {
for_each = var.allowed_aws_services

content {
sid = "AllowService${index(var.allowed_aws_services, statement.value)}"
effect = "Allow"
principals {
type = "Service"
Expand All @@ -38,6 +40,7 @@ data "aws_iam_policy_document" "current" {
for_each = var.allowed_aws_principals

content {
sid = "AllowPrincipal${index(var.allowed_aws_principals, statement.value)}"
effect = "Allow"
principals {
type = "AWS"
Expand Down
2 changes: 1 addition & 1 deletion examples/slack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module "notifications" {
source = "../.."

allowed_aws_services = ["cloudwatch.amazonaws.com"]
allowed_aws_services = ["cloudwatch.amazonaws.com", "cloudtrail.amazonaws.com"]
create_sns_topic = true
sns_topic_name = var.sns_topic_name
tags = var.tags
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module "notifications" {
version = "v6.0.1"
count = var.create_sns_topic ? 1 : 0

name = var.sns_topic_name
tags = var.tags
topic_policy_statements = local.sns_topic_policy
name = var.sns_topic_name
source_topic_policy_documents = [local.sns_topic_policy]
tags = var.tags
}

## Provision any email notifications if required
Expand Down

0 comments on commit 5cf6b11

Please sign in to comment.