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(iam-group-with-policies): Related resources shouldn't be created when group creation is disabled #440

Closed

Conversation

pawelpesz
Copy link

Description

Related resources shouldn't be created when group creation is disabled

Motivation and Context

In some scenarios the iam-group-with-policies submodule attempts to create aws_iam_group_membership, aws_iam_policy and aws_iam_group_policy_attachment resources even though the create_group variable is set to false. Workarounds do exist, but ultimately this behaviour is undesired.

Breaking Changes

None.

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

Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Dec 28, 2023
@pawelpesz
Copy link
Author

Not stale, just updated.

@github-actions github-actions bot removed the stale label Dec 29, 2023
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Jan 28, 2024
@pawelpesz
Copy link
Author

Not stale.

@github-actions github-actions bot removed the stale label Jan 30, 2024
@pawelpesz
Copy link
Author

Hello @bryantbiggs, sorry to bother you, but could you take a quick look at this PR? It's nothing controversial, just a simple fix for something that got overlooked. Thank you!

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

This is not an issue, but an expected behavior of the module.


create_group = false

name = "custom-disabled"
Copy link
Member

Choose a reason for hiding this comment

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

When create_group is set to false, then it expects that the IAM group with the name specified in name has already been created. Also, this module adds provided properties (such as group_users, custom_group_policy_arns, ...) to it.

Copy link
Author

@pawelpesz pawelpesz Feb 16, 2024

Choose a reason for hiding this comment

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

@antonbabenko with due respect, but I don't see the same behaviour being followed in the other modules, iam-user for example.

Copy link
Member

Choose a reason for hiding this comment

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

If we had called this module iam-group, then the scope of resources should be - all or nothing (like in iam-user), but since it is iam-group-with-policies, it expects IAM group in one way or another.

Copy link
Author

Choose a reason for hiding this comment

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

I found this behaviour pretty confusing @antonbabenko, but fair enough, thank you for the explanation 🙏

Copy link
Member

Choose a reason for hiding this comment

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

I agree it is confusing.

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 Mar 18, 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.

2 participants