-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make google_project_services resource importable #601
Conversation
@@ -71,6 +74,7 @@ func resourceGoogleProjectServicesRead(d *schema.ResourceData, meta interface{}) | |||
return err | |||
} | |||
|
|||
d.Set("project", d.Id()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, done.
…le_project_services_test.go
There was a problem hiding this 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
* Make google_project_services resource importable * Reuse testAccGoogleProjectAssociateServicesBasic() from resource_google_project_services_test.go
<!-- This change is generated by MagicModules. --> Original Author: @chrisst
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! |
No description provided.