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

Make google_project_services resource importable #601

Merged
merged 2 commits into from
Oct 23, 2017

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Oct 18, 2017

No description provided.

@@ -71,6 +74,7 @@ func resourceGoogleProjectServicesRead(d *schema.ResourceData, meta interface{})
return err
}

d.Set("project", d.Id())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should project content be checked before overwriting?

Copy link
Contributor

Choose a reason for hiding this comment

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

Eh I don't think it needs to be but may as well throw an error

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

Thanks @pdecat! This looks good overall, just one quick piece of feedback.

})
}

func testAccGoogleProjectServices_import(projectId, orgId, projectName string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is so similar to testAccGoogleProjectAssociateServicesBasic from resource_google_project_services_test.go, what if you just called that function instead of having a new one here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done.

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

$ make testacc TEST=./google TESTARGS='-run=TestAccGoogleProjectServices -parallel 8' GOOGLE_USE_DEFAULT_CREDENTIALS=true
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccGoogleProjectServices -parallel 8 -timeout 120m
=== RUN   TestAccGoogleProjectServices_importBasic
=== RUN   TestAccGoogleProjectServices_basic
=== RUN   TestAccGoogleProjectServices_authoritative
=== RUN   TestAccGoogleProjectServices_authoritative2
=== RUN   TestAccGoogleProjectServices_ignoreUnenablableServices
=== RUN   TestAccGoogleProjectServices_manyServices
2017/10/23 13:46:41 [DEBUG]: Converted list of strings to "iam.googleapis.com","cloudresourcemanager.googleapis.com","servicemanagement.googleapis.com"
--- PASS: TestAccGoogleProjectServices_authoritative (82.30s)
--- PASS: TestAccGoogleProjectServices_authoritative2 (86.61s)
--- PASS: TestAccGoogleProjectServices_importBasic (107.42s)
--- PASS: TestAccGoogleProjectServices_basic (118.30s)
--- PASS: TestAccGoogleProjectServices_ignoreUnenablableServices (408.47s)
--- PASS: TestAccGoogleProjectServices_manyServices (1204.45s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	1204.612s

@danawillow danawillow merged commit 16611cb into hashicorp:master Oct 23, 2017
@pdecat pdecat deleted the f-import-project-services branch March 7, 2018 09:00
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
* Make google_project_services resource importable

* Reuse testAccGoogleProjectAssociateServicesBasic() from resource_google_project_services_test.go
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
Original Author: @chrisst
@ghost
Copy link

ghost commented Mar 29, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants