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

Add support to importing a project by projectnumber #6427

Closed
wants to merge 1 commit into from

Conversation

spew
Copy link
Contributor

@spew spew commented May 20, 2020

Some google services, such as Cloud Asset Inventory, use the ProjectNumber as the ID of the project instead of the project id. This change adds support to importing by Number to the Project resource.

@ghost ghost added the size/xs label May 20, 2020
@ghost ghost requested review from emilymye May 20, 2020 17:07
@emilymye
Copy link
Contributor

Do you mind adding a test to resource_google_project_test.go? You can add a test step (or 2) to TestAccProject_create that uses the (Import step format)[https://github.com/GoogleCloudPlatform/magic-modules/blob/4540f9c4260c86d6d7361641097a18255da00228/third_party/terraform/tests/resource_google_project_test.go#L142-L147] - ideally we'd want one with ImportStateId : "projects/" + projectNumber and one with ImportStateId : "projects/" + pid to be explicit

// Ensure the id format includes projects/
d.SetId(fmt.Sprintf("projects/%s", pid))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here and at the top of Read() saying that project ID might be either project ID or number?

@spew
Copy link
Contributor Author

spew commented Jun 5, 2020

Yes -- I will do so

@c2thorn
Copy link
Collaborator

c2thorn commented Oct 8, 2020

Hey @spew , we are cleaning up some lingering PR's. Is this something you are still intending to work on? Otherwise we can probably close after a few days.

@spew
Copy link
Contributor Author

spew commented Oct 8, 2020

Hi, yes, I would like to get this in.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this pull request Aug 19, 2022
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this pull request Aug 19, 2022
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
@rileykarson
Copy link
Collaborator

Closing PR as stale

Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants