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

Simplify project_id output in core_project_factory #572

Conversation

MartinPetkov
Copy link
Contributor

I ran into a case where somehow google_compute_shared_vpc_service_project.shared_vpc_attachment was an "empty tuple" in the state, and this output was failing because it was trying to index into it. I came across hashicorp/terraform#25578, which might be related, but it does still happen with the latest version of Terraform as of opening this bug (v0.14.9).

Regardless, it seems to me that all this is doing is building a list then taking the first element, so the one-liner should be equivalent and avoids this error.

I ran into a case where somehow `google_compute_shared_vpc_service_project.shared_vpc_attachment` was an "empty tuple" in the state, and this output was failing because it was trying to index into it. I came across hashicorp/terraform#25578, which might be related, but it does still happen with the latest version of Terraform as of opening this bug (v0.14.9).

Regardless, it seems to me that all this is doing is building a list then taking the first element, so the one-liner should be equivalent.
@MartinPetkov MartinPetkov requested a review from a team as a code owner March 31, 2021 19:48
@comment-bot-dev
Copy link

comment-bot-dev commented Mar 31, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

IIRC when building the list it will resolve all elements and then take the first element so we are able to wait on svpc which was added in #432. I don't think we should remove the wait on svpc, perhaps we can use try to catch the null error?

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Let's make sure to keep the same dependencies list.

@morgante morgante merged commit 1bde0af into terraform-google-modules:master Apr 5, 2021
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.

4 participants