-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Compacted list with resource attribute breaks plan when using count #25152
Comments
@gieldb AWS resource IDs are assigned by AWS after they are created, so this information will not be available until after the I understand why it would be nice to do what you're trying to do, but this is working as expected and the error message does more or less explain what's going on. I know reasoning about the order of functions vs resource creation is non-intuitive - this caught me off guard as well. I can't quite tell whether you're asking us to put an enhancement request on our backlog, or if you're looking for guidance about how to solve this particular use case. I see two options:
Based on my work so far, I recommend you take this to the community forum for assistance in troubleshooting. I'm going to close this for now, because I think the community forum is the right approach. Feel free to leave a note or contact me at [email protected] to re-open this if you'd rather work up a more detailed workflow and file this as an enhancement request. |
I just created a meta issue to track issues of this category, because I was triaging and the very next issue in the queue was basically the same category. I know this behavior isn't super obvious, but fixing it is a pretty huge refactor, so I am starting to gather data now. |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
The variable
allowed_sg_id
should be passed to the module, stripped of empty tuples (compact).Actual Behavior
It seems like the value of
aws_security_group.test.id
is being calculated, which is not possible before apply. Removing the compact makesterraform plan
without issues.Steps to Reproduce
Pass a compacted list with a resource to be calculated on apply, and use it in a count
Additional Context
References
The text was updated successfully, but these errors were encountered: