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

feat: Added number_of_ variables for iam-assumable-role submodules #96

Merged

Conversation

Zyntogz
Copy link
Contributor

@Zyntogz Zyntogz commented Sep 24, 2020

fix for terraform error for assumable-role"number of resources cannot be determined during runtime" in iam-assumable-role

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.

Good. Also, please update examples and docs (run pre-commit run -a), if you can.

@@ -66,7 +66,7 @@ resource "aws_iam_role" "this" {
}

resource "aws_iam_role_policy_attachment" "custom" {
count = var.create_role ? length(var.role_policy_arns) : 0
count = var.create_role ? var.number_role_policy_arns : 0
Copy link
Member

Choose a reason for hiding this comment

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

number_of_role_policy_arns

@@ -76,6 +76,12 @@ variable "custom_role_policy_arns" {
default = []
}

variable "number_custom_role_policy_arns" {
Copy link
Member

Choose a reason for hiding this comment

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

number_of_custom_role_policy_arns

@Zyntogz Zyntogz changed the title fix for terraform error for assumable-role fix: fix for terraform error for assumable-role Oct 13, 2020
@antonbabenko antonbabenko changed the title fix: fix for terraform error for assumable-role feat: Added number_of_ variables for iam-assumable-role submodules Oct 30, 2020
@antonbabenko antonbabenko merged commit f34e103 into terraform-aws-modules:master Oct 30, 2020
@antonbabenko
Copy link
Member

Thank you!

v2.26.0 has been just released.

@llamahunter
Copy link

Please revert this change. It is not backwards compatible.

@antonbabenko
Copy link
Member

v3.1.0 has been just released with this PR, while v2.25.0 is the latest in v2 where the behavior is the same as before this PR was merged.

Apologize for the confusion.

@horjulf
Copy link

horjulf commented Nov 3, 2020

Wouldn't leveraging for_each be a better approach here ?
This is very error prone, especially with the default 0.

@antonbabenko
Copy link
Member

@horjulf for_each will act exactly like count in this case. There is no better workaround in Terraform 0.13 for computed values being used in meta-arguments like count and for_each.

@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 Nov 10, 2022
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.

None yet

4 participants