Commit Graph

20 Commits

Author SHA1 Message Date
The Magician
23db6b0c12 Fix golangci-lint errors (#3059)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-14 16:00:35 -08:00
The Magician
05d558d33f Add disable_dependent_services to google_project_service resource. (#2938)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-01-28 13:50:41 -08:00
The Magician
91a513ab83 clean up operation code (#2734) 2018-12-26 17:42:37 -08:00
The Magician
c605b0bc4b [Terraform]: Apply gofmt -s to all files managed by MM (#2676)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
The Magician
ff16c8f4e0 Don't allow users to specify certain APIs in google_project_services (#2468)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
Dana Hoffman
bec963fdfa
remove containeranalysis from ignore list (#2095) 2018-09-21 15:58:42 -07:00
Riley Karson
37de4312e3
go tool fix google (#2019) 2018-09-10 15:07:48 -07:00
Paddy Carver
d80c92f33f Add stackdriverprovisioning to ignored APIs.
Add stackdriverprovisioning.googleapis.com to our list of APIs that are
automateically enabled that Terraform can't act on.
2018-07-12 13:40:30 -07:00
Kevin McHale
9c9eccc206 Add nextPageToken to fields argument against ServiceUsage api 2018-07-06 15:37:19 -04:00
Seth Vargo
aff6bc6519 Retry while listing enabled services (#1573)
This fixes GH-1562 for realz
2018-05-31 14:50:38 -07:00
Seth Vargo
40094ba417 Lions, tigers, and services being enabled with "precondition failed", oh my! (#1565)
* Use errwrap to retain original error

* Use built-in Page function, only return names when listing services

This removes the custom logic on pagination and uses the built-in Page function in the SDK to make things a bit simpler. Additionally, I added a field filter to only return service names, which drastically reduces the size of the API call (important for slow connections, given how frequently this function is executed).

Also added errwrap to better trace where errors originate.

* Add helper function for diffing string slices

This just looked really nasty inline

* Batch 20 services at a time, handle precondition failed, better errwrap

This commit does three things:

1. It batches services to be enabled 20 at a time. The API fails if you try to enable more than 20 services, and this is documented in the SDK and API. I learned this the hard way. I think Terraform should "do the right thing" here and batch them in series' of twenty, which is what this does. Each batch is tried in serial, but I think making it parallelized is not worth the complexity tradeoffs.

2. Handle the precondition failed error that occurs randomly. This just started happened, but it affects at least two APIs consistently, and a rudimentary test showed that it failed 78% of the time (78/100 times in an hour). We should fix this upstream, but that failure rate also necessitates (in my opinion) some mitigation on the Terraform side until a fix is in place at the API level.

3. Use errwrap on errors for better tracing. It was really difficult to trace exactly which error was being throw. That's fixed.

* Updates from code review
2018-05-31 09:26:40 -07:00
Vincent Roseberry
8bb494520f
project field for google_project_services can use the default provider project (#1553) 2018-05-29 14:26:58 -07:00
Paddy Carver
4ec59fccea Guard against eventually consistent services
When enabling services, after the waiter returns, list the enabled
services and ensure the ones we enabled are in there. If not, retry. May
not always resolve #1393, but should help. Unfortunately, the real
answer is probably either:

1. For us to try and get the API updated to only return the waiter when
the service will consistently be available. I don't know how feasible
this is, but I'm willing to open a ticket.
2. For us to build retries into ~all our resources to retry for a set
amount of time when a service not enabled error is returned. This would
greatly slow down the provider in the case of the service legitimately
not being enabled, but is how other providers handle this class of
problem.

Unfortunately, due to the eventual consistency at play, this is a hard
issue to reproduce and prove, though it matches with my
experience--while testing this patch, one of the tests failed with the
error that the serviceusage API hadn't been enabled, but only on step 4
of the test, when calls had already succeeded. Which suggests eventual
consistency, to me. Regardless, this patch shouldn't _hurt_ and should
mostly be an imperceptible change to users, and should make instances
like #1393 less likely.
2018-05-23 04:01:05 -07:00
Dana Hoffman
20616e424d
Use new serviceusage API for google_project_service[s] (#1522)
* vendor service usage api

* use serviceusage api instead of servicemanagement for project services

* add bigquery-json to test

* add import for project service

* add serviceusage_operation.go
2018-05-22 17:45:22 -07:00
Vincent Roseberry
1bf076f6a9
Add disable_on_destroy flag to project_services (#1293) 2018-04-04 16:20:13 -07:00
Nathan McKinley
9d3e64cdaf
Add cloud endpoints resource (#933)
OpenAPI & gRPC Endpoints on Compute Engine.

New Resource:
- Endpoints Service Create/Read/Delete
- Example terraform config
2018-01-24 13:03:57 -08:00
Dana Hoffman
2c8dbac663
Fix timeout issue with project services (#737)
* retry api enablement/disablement for 10 minutes

* retry to retryTime
2017-11-14 11:41:57 -08:00
Dana Hoffman
10e4f68441
Add new google_project_service resource for fine-grained service control. (#668)
* add new project service resource; add retry logic for enable/disable

* docs for google_project_service

* add project into the id
2017-11-07 15:19:57 -08:00
Patrick Decat
16611cb3ac Make google_project_services resource importable (#601)
* Make google_project_services resource importable

* Reuse testAccGoogleProjectAssociateServicesBasic() from resource_google_project_services_test.go
2017-10-23 14:23:51 -07:00
Jake Champlin
66029ac431
Transfer google provider 2017-06-06 11:58:51 -04:00