-
Notifications
You must be signed in to change notification settings - Fork 459
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
Get one element from module output list(target_group_arns of terraform-aws-modules/alb/aws) #1087
Comments
Thank you very much! It seems like it is working. I divided my configuration in several stacks. One of them has nested list as output. Now I need to get this list from another stack and extract separate elements. Output variable is in the following format:
When I tried to use nested Fn.element, I got the same error during the plan as previously: code:
error:
I didn’t find fqn property of DataTerraformRemoteState, so I’m using following solution now:
It seems like it is working, but I think it is not the best solution. Are there any other options? Thank you in advance! |
Seems like you're hitting a bug, so the workaround you have is fine. |
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've 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. |
Community Note
cdktf & Language Versions
cdktf 0.6.3
cdktf-cdktf-provider-aws 2.0.11
terraform-aws-modules/alb/aws@5.16.0
Python 3.8.10
Affected Resource(s)
I created several aws albs via module and want to get single element from their output list (target_group_arns) to create subsequent resources(ecs services).
I tried different approaches, the last one was as following(for test purposes I hardcoded index values):
Expected Behavior
I thought, that in json output will appear something like:
"target_group_arn": "${element(module.stack-name-lb2.target_group_arns, 0)}"
And then this string will be substituted with needed value during apply
Actual Behavior
I can synthesize code successfully, but during the plan I get several errors like this one:
The text was updated successfully, but these errors were encountered: