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

var.create && var.create_iam_role evaluated before the creation of the map not after #2509

Closed
wants to merge 1 commit into from

Conversation

ryanpeach
Copy link

Description
This PR fixes the issue with the for_each expression in the code, where var.create_iam_role was unable to overwrite a broken for_each expression. It changes the code to evaluate user variables first, and then if they are true, evaluates the list comprehension.

Motivation and Context
The issue with the for_each expression in the code has been reported in multiple issues (#2337, #1753, and #2411), and this PR aims to fix it for users creating their own iam role. This change evaluates user variables first, and then if they are true, evaluates the list comprehension, which solves an issue if some locals are only known after apply. See full comment #2458 (comment)

Breaking Changes
There are no breaking changes with this PR.

How Has This Been Tested?

  • I tested on a local terraform deployment
  • I ran pre-commit as requested

I apologize as I have no reproducible minimum for you to evaluate on, hopefully someone else can provide it.

@bryantbiggs
Copy link
Member

I apologize as I have no reproducible minimum for you to evaluate on, hopefully someone else can provide it.

We will not accept changes unless someone can provide a reproduction first that demonstrates the issue

@bryantbiggs bryantbiggs closed this Mar 8, 2023
@ryanpeach
Copy link
Author

I understand the desire to have a reproduction, but I, unfortunately, have too much on my plate.

You are seeing a lot of issues on this one line and my change disables that line in a way the user can then fix it themselves.

@github-actions
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 10, 2023
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