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

Conversation

SwarajBaral
Copy link
Contributor

@SwarajBaral SwarajBaral commented Mar 21, 2024

Description

Replaced the defined assume_role_policy with an inline policy and with that the IAM policy for CloudWatch Logs is properly attached to the role, and a valid assume role policy is defined, granting AWS SNS the right to assume the role.

Motivation and Context

Fixes #219

Breaking Changes

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@SwarajBaral SwarajBaral changed the title Added inline assume_role_policy for sns_feedback_role fix: added inline assume_role_policy for sns_feedback_role Mar 21, 2024
@SwarajBaral SwarajBaral changed the title fix: added inline assume_role_policy for sns_feedback_role fix: Added inline assume_role_policy for sns_feedback_role Mar 21, 2024
@@ -31,7 +31,16 @@ resource "aws_iam_role" "sns_feedback_role" {
path = var.sns_topic_feedback_role_path
force_detach_policies = var.sns_topic_feedback_role_force_detach_policies
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

iam.tf Outdated
@@ -31,7 +31,16 @@ resource "aws_iam_role" "sns_feedback_role" {
path = var.sns_topic_feedback_role_path
force_detach_policies = var.sns_topic_feedback_role_force_detach_policies
permissions_boundary = var.sns_topic_feedback_role_permissions_boundary
assume_role_policy = data.aws_iam_policy_document.sns_feedback[0].json
assume_role_policy = jsonencode({
Version = "2012-10-17",
Copy link
Member

Choose a reason for hiding this comment

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

part 2:
Replace the permissions here with the permissions defined below

also, I guess this has been broken for 2 years?! 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am hoping you meant extend this with the inline permission that I had added ?

@bryantbiggs bryantbiggs changed the title fix: Added inline assume_role_policy for sns_feedback_role fix: Correct assume role permissions for SNS service to assume IAM role Mar 26, 2024
@bryantbiggs bryantbiggs merged commit dae0c0f into terraform-aws-modules:master Mar 26, 2024
8 checks passed
antonbabenko pushed a commit that referenced this pull request Mar 26, 2024
## [6.1.2](v6.1.1...v6.1.2) (2024-03-26)

### Bug Fixes

* Correct assume role permissions for SNS service to assume IAM role ([#220](#220)) ([dae0c0f](dae0c0f))
@antonbabenko
Copy link
Member

This PR is included in version 6.1.2 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNS Feedback role is broken
3 participants