Skip to content

Mark project as computed for iam-project #1874

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

Merged

Conversation

chrisst
Copy link
Contributor

@chrisst chrisst commented Jun 4, 2019

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 when project 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 set project 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 the id can exist in a couple different formats depending on the lifecycle. In various parts of import it's going to be a different format than if called during Read.

@chrisst chrisst requested a review from slevenick June 4, 2019 00:04
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of dc61179.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#805
depends: hashicorp/terraform-provider-google#3777

@slevenick
Copy link
Contributor

project is already marked Computed in many (most?) of the other iam resources as well, so I don't have a problem with this

chrisst and others added 2 commits June 4, 2019 20:50
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
@modular-magician modular-magician force-pushed the iam-project-import-fix branch from dc61179 to 1541a4e Compare June 4, 2019 20:50
@modular-magician modular-magician merged commit 6b57cb3 into GoogleCloudPlatform:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants