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: prevent lambda IAM policies from detaching when orders are swapped #630

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tammyisaninja
Copy link

Description

Used for loop instead of count for resource "aws_iam_role_policy_attachment" "additional_many" to ensure that changing orders of the policy will not detach them

Motivation and Context

Fixes #629

I have a project on production where I used the module and added the policies to the lambda.

Subsequently, I swapped the order of the policies and they got detached from the lambda, this caused a production issue as the lambda lacked permissions. Would like to ensure that this does not happen again.

Breaking Changes

None that I am aware of

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
    There is no need to update as it applies to existing config

  • 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

image - terraform validate hook could not execute

I have also tested again the local code in the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda IAM Policies Detaching from created IAM Role when Input Order is Changed
2 participants