Skip to content

Add google_project_services data source #1822

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
merged 1 commit into from
Aug 15, 2018

Conversation

cblecker
Copy link
Contributor

@cblecker cblecker commented Jul 27, 2018

Been awhile since I contributed, so please let me know if I've missed something.

This should add a google_project_services data source, to view the enabled service on a GCP project.

Acceptance Test:

$ make testacc TESTARGS="-run TestAccDataSourceGoogleProjectServices_basic"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccDataSourceGoogleProjectServices_basic -timeout 120m
?       github.com/terraform-providers/terraform-provider-google        [no test files]
=== RUN   TestAccDataSourceGoogleProjectServices_basic
=== PAUSE TestAccDataSourceGoogleProjectServices_basic
=== CONT  TestAccDataSourceGoogleProjectServices_basic
--- PASS: TestAccDataSourceGoogleProjectServices_basic (41.10s)
PASS
ok      github.com/terraform-providers/terraform-provider-google/google 41.136s
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-google/scripts        (cached) [no tests to run]

@cblecker cblecker force-pushed the project-services-data branch 6 times, most recently from 7f8ab15 to eb812e0 Compare July 31, 2018 23:55
@cblecker
Copy link
Contributor Author

cblecker commented Aug 1, 2018

Updated PR with passing acceptance tests (remembered how to run those haha)

@cblecker
Copy link
Contributor Author

@danawillow Hi Dana! Been awhile since I've contributed here (last time I did was prior to the provider split). Not sure what the procedure is right now for PR reviews, but if you have any guidance/advice, it would be appreciated. Thank you!

@danawillow
Copy link
Contributor

Hiya! We have a rotation each week of who's in charge of bug fixes and PR reviews. It hasn't been me in a few weeks, but it seems like the past ondutys hadn't gotten to yours, so I'm happy to take a look.

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.

Looks good! Just one quick nit.

func dataSourceGoogleProjectServicesRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

if v, ok := d.GetOk("project"); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is exactly what getProject does, so you can get rid of the first part of this if statement and leave everything that's in the else block.

@cblecker cblecker force-pushed the project-services-data branch from eb812e0 to e57cb2c Compare August 15, 2018 22:23
@cblecker
Copy link
Contributor Author

Awesome! Thanks for the review, @danawillow! I've updated it per your comment 😄

@danawillow danawillow merged commit 60dc8bc into hashicorp:master Aug 15, 2018
@cblecker cblecker deleted the project-services-data branch August 15, 2018 22:51
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
@ghost
Copy link

ghost commented Nov 17, 2018

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 17, 2018
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