Mark project as computed for iam-project #1874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes hashicorp/terraform-provider-google#3765
I'm not super keen on marking this Computed but I think it's the better of the two options.
We're currently setting the
project
in state during the import because that allows us to import a resource whenproject
hasn't been set as a default value in the provider or to import from a different project than the default. This has the unfortunate byproduct of forcing people to setproject
in the config when importing as you can see in the bug.We could add some logic to parse the project out of the
id
when calling Read but it would require a more complicated parse function because theid
can exist in a couple different formats depending on the lifecycle. In various parts ofimport
it's going to be a different format than if called during Read.