Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct assume role permissions for SNS service to assume IAM role #220

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.0
rev: v1.88.4
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
21 changes: 11 additions & 10 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ data "aws_iam_policy_document" "sns_feedback" {
count = local.create_sns_feedback_role ? 1 : 0

statement {
sid = "PermitDeliveryStatusMessagesToCloudWatchLogs"
sid = "SnsAssume"
effect = "Allow"

actions = [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutMetricFilter",
"logs:PutRetentionPolicy"
"sts:AssumeRole",
"sts:TagSession",
]

resources = [
"*"
]
principals {
type = "Service"
identifiers = ["sns.amazonaws.com"]
}
}
}

Expand All @@ -33,5 +31,8 @@ resource "aws_iam_role" "sns_feedback_role" {
permissions_boundary = var.sns_topic_feedback_role_permissions_boundary
assume_role_policy = data.aws_iam_policy_document.sns_feedback[0].json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part 1:
lets leave this as is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


tags = merge(var.tags, var.sns_topic_feedback_role_tags)
tags = merge(
var.tags,
var.sns_topic_feedback_role_tags,
)
}