Commit Graph

912 Commits

Author SHA1 Message Date
Thomas Poindessous
446a2cd6e9 Cleanup 2017-03-08 12:21:30 +01:00
Thomas Poindessous
11857816d1 [WIP]: added a test acceptance for google_compute_snapshot 2017-03-07 10:49:02 +01:00
Paddy
6ea1b17f8f provider/google: fix container instance group URLs
Google Container Engine's cluster API returned instance group manager
URLs when it meant to return instance group URLs. See #4336 for details
about the bug.

While this is undeniably an upstream problem, this PR:

* detects the error, meaning it will work as expected when the API is
  fixed.
* corrects the error by requesting the instance group manager, then
  retrieving its instance group URL, and using that instead.
* adds a test that exercises the error and the solution, to ensure it is
  functioning properly.
2017-03-06 21:14:32 -08:00
Thomas Poindessous
32f5c0d421 WIP: added a new resource type : google_compute_snapshot 2017-03-07 00:26:38 +01:00
Dana Hoffman
2486f618d8 provider/google: initial commit for node pool resource (#11802)
provider/google: initial commit for node pool resource
2017-03-06 14:59:24 -08:00
Paddy
bbad8be2f3 Merge pull request #12434 from hashicorp/paddy_fix_gcp_storage_region_test
provider/google: add location to storage tests.
2017-03-03 16:58:18 -08:00
Paddy
8d223b5af7 provider/google: log the op name in sql op errors.
To aid in tracking down the error that's causing
TestAccGoogleSqlDatabaseInstance_basic to fail (it's claiming an op
can't be found?) I've added the op name (which is unique) to the error
output for op errors.
2017-03-03 16:45:25 -08:00
Paddy
629dfe7ad7 provider/google: add location to storage tests.
Add location to storage tests that need it, which fixes the failing
TestAccStorageStorageClass test.
2017-03-03 15:51:36 -08:00
Paddy
7238458619 provider/google: retry storage creation/deletion on rate limiting
Our GCP storage tests are really flaky right now due to rate limiting.
In theory, this could also impact Terraform users that are
deleting/creating large numbers of Google Cloud Storage buckets at once.

To fix, I'm detecting the specific error code that GCP returns when it's
a rate limit error, and using that with resource.Retry to try the
request again.
2017-03-02 16:42:28 -08:00
Paddy
ce3c599f6f provider/google: ignore expanded v collapsed policies in diff
When comparing the config and state for google_project_iam_policy,
always merge the bindings down to a common representation, to avoid a
perpetual diff.

Fixes #11763.
2017-03-02 14:00:45 -08:00
Dana Hoffman
0bf54f4fe4 provider/google: fix url map test and update logic (#12317) 2017-03-01 09:47:12 +00:00
Paddy
d1e103b4d2 provider/google: add migration notes for projects
Update the docs for `google_project` with @zachgersh's suggestions
(#11895) to properly communicate the changes that took place in 0.8.5.
While they don't break any current configs or state, the new behaviour
should be called out for people who were using the old behaviour and are
adding new projects to their configs/state.

I also took this opportunity to update google_project_iam_policy with a
note to users letting them know that there be dragons.
2017-02-24 00:56:05 -08:00
Paddy
869c7a6103 Update the docs for resolveImage.
Update the explanation of the logic being followed in resolveImage.
2017-02-23 22:09:07 -08:00
Paddy
e55e5e9119 provider/google: update image resolution code.
Add tests that ensure that image syntax resolves to API input the way we
want it to.

Add a lot of different input forms for images, to more closely map to
what the API accepts, so anything that's valid input to the API should
also be valid input in a config.

Stop resolving image families to specific image URLs, allowing things
like instance templates to evolve over time as new images are pushed.
2017-02-23 21:55:30 -08:00
Paddy
a720f10b27 Merge branch 'master' into paddy_10984_better_image_resolution 2017-02-23 15:12:47 -08:00
Evan Brown
c7632cdf2e providers/google: google_project supports billing account (#11653)
* Vendor google.golang.org/api/cloudbilling/v1

* providers/google: Add cloudbilling client

* providers/google: google_project supports billing account

This change allows a Terraform user to set and update the billing
account associated with their project.

* providers/google: Testing project billing account

This change adds optional acceptance tests for project billing accounts.
GOOGLE_PROJECT_BILLING_ACCOUNT and GOOGLE_PROJECT_BILLING_ACCOUNT_2
must be set in the environment for the tests to run; otherwise, they
will be skipped.

Also includes a few code cleanups per review.

* providers/google: Improve project billing error message
2017-02-20 19:32:24 +02:00
Evan Brown
bf10e5519d providers/google: google_project supports billing account (#11653)
* Vendor google.golang.org/api/cloudbilling/v1

* providers/google: Add cloudbilling client

* providers/google: google_project supports billing account

This change allows a Terraform user to set and update the billing
account associated with their project.

* providers/google: Testing project billing account

This change adds optional acceptance tests for project billing accounts.
GOOGLE_PROJECT_BILLING_ACCOUNT and GOOGLE_PROJECT_BILLING_ACCOUNT_2
must be set in the environment for the tests to run; otherwise, they
will be skipped.

Also includes a few code cleanups per review.

* providers/google: Improve project billing error message
2017-02-20 19:32:24 +02:00
Dana Hoffman
108ef0e4f7 provider/google: Write the raw disk encryption key in the state file to avoid diffs on plan (#12068) 2017-02-20 19:28:32 +02:00
George Christou
06fa75423e website/docs: Run terraform fmt on code examples (#12075)
* docs/vsphere: Fix code block

* docs: Convert `...` to `# ...` to allow `terraform fmt`ing

* docs: Trim trailing whitespace

* docs: First-pass run of `terraform fmt` on code examples
2017-02-19 00:48:50 +02:00
Patrick Decat
fc78bd934d Update google_sql_user example as password is a required argument (#12053) 2017-02-18 16:16:14 +02:00
Paddy
df2d63f69a Merge pull request #12044 from sbadia/gcs_storage_class
doc: gcs - Update storage_class documentation and tests
2017-02-17 16:13:29 -08:00
Paddy
24393a64ea Merge pull request #12044 from sbadia/gcs_storage_class
doc: gcs - Update storage_class documentation and tests
2017-02-17 16:13:29 -08:00
Patrick Decat
d9c31525dc google_sql_database_instance: pricing_plan only applies to first generation instances (#12054)
As stated in the second generation pricing documentation:

> Second Generation pricing is composed of the following charges:
> 
> Instance pricing
> Storage pricing
> Network pricing
> There is no choice of pricing plan.

cf. https://cloud.google.com/sql/pricing#2nd-gen-pricing
2017-02-18 01:38:38 +02:00
Patrick Decat
11c56cfd5e google_sql_database_instance name cannot be reused for one week, not two months (#12055)
According to the referenced documentation, it is one week, not two months:

> You cannot reuse an instance name for up to a week after you have deleted an instance.

cf. https://cloud.google.com/sql/docs/mysql/delete-instance
2017-02-18 01:37:58 +02:00
Mike Fowler
b1b6993d23 provider/google-cloud: Add maintenance window (#12042)
* provider/google-cloud: Add maintenance window

Allows specification of the `maintenance_window` within the `settings`
block. This controls when Google will restart a database in order to
apply updates. It is also possible to select an `update_track` to
relatively control updating between instances in the same project.

* Adjustments as suggested in code review.
2017-02-18 01:33:47 +02:00
Mike Fowler
c866f8bf6c provider/google-cloud: Add maintenance window (#12042)
* provider/google-cloud: Add maintenance window

Allows specification of the `maintenance_window` within the `settings`
block. This controls when Google will restart a database in order to
apply updates. It is also possible to select an `update_track` to
relatively control updating between instances in the same project.

* Adjustments as suggested in code review.
2017-02-18 01:33:47 +02:00
Seth Vargo
2d4b3c2205 Merge pull request #12056 from pdecat/patch-3
Doc: fix 404 on API link
2017-02-17 13:34:36 -05:00
Sebastien Badia
93a3364b2e doc: gcs - Update storage_class documentation and tests
`STANDARD` storage_class is now replaced by `MULTI_REGIONAL` depending
the bucket location. Same for `DURABLE_REDUCED_AVAILABILITY` replaced
by `REGIONAL`.

refs: https://cloud.google.com/storage/docs/storage-classes#standard
2017-02-17 15:59:25 +01:00
Sebastien Badia
051423ee28 doc: gcs - Update storage_class documentation and tests
`STANDARD` storage_class is now replaced by `MULTI_REGIONAL` depending
the bucket location. Same for `DURABLE_REDUCED_AVAILABILITY` replaced
by `REGIONAL`.

refs: https://cloud.google.com/storage/docs/storage-classes#standard
2017-02-17 15:59:25 +01:00
Paddy
ecbbaaee89 Check for errors when deleting project metadata.
Our delete operation for google_compute_project_metadata didn't check an
error when making the call to delete metadata, which led to a panic in
our tests. This is also probably indicative of why our tests
failed/metadata got left dangling.
2017-02-16 02:36:03 -08:00
Dana Hoffman
3434a0e15c Merge pull request #11631 from drebes/lts_fix
provider/google: make local_traffic_selector computed now that we rea…
2017-02-15 12:57:25 -08:00
Roberto Jung Drebes
8b82adfdbe provider/google: make local_traffic_selector computed now that we read it back from server 2017-02-15 19:48:44 +01:00
Radek Simko
566ad81b31 provider/google: Add google_compute_zones data source 2017-02-15 09:50:25 +00:00
Radek Simko
f353843c2f provider/google: Add google_compute_zones data source 2017-02-15 09:50:25 +00:00
Dana Hoffman
5a3eb9394e Merge pull request #11840 from danawillow/gke-version
provider/google: Update node version in container cluster test
2017-02-09 16:33:43 -08:00
Dana Hoffman
c6b1b37eb5 provider/google: Update node version in container cluster test 2017-02-09 16:14:00 -08:00
Dana Hoffman
43d968cabe provider/google: set subnetwork_project to computed 2017-02-08 15:26:47 -08:00
Dana Hoffman
30b83cb0a6 Merge pull request #11650 from danawillow/google-container
provider/google: set additional_zones to computed and disallow the original zone from appearing in the list
2017-02-08 15:12:08 -08:00
Paddy
4094ed6dc9 provider/google: update DNS names in tests.
Our DNS tests were using terraform.test as a DNS name, which GCP was
erroring on, as we haven't proven we own the domain (and can't, as we
don't). To solve this, I updated the tests to use hashicorptest.com,
which we _do_ own, and which we have proven ownership of. The tests now
pass.
2017-02-08 10:24:04 -08:00
Dana Hoffman
562c25dba8 provider/google: always set additional_zones on read 2017-02-07 19:21:00 -08:00
Dana Hoffman
e0663f35b2 providers/google: disallow specifying the original zone in additional_zones, change field to computed 2017-02-07 11:02:02 -08:00
Jake Champlin
8107cce1f4 Merge pull request #11735 from hashicorp/paddy_11728_with_tests
Revert backwards incompatibility in google_project.policy_data
2017-02-07 11:50:59 -05:00
Paddy
6dfca0f836 Add a test that would have caught backwards incompatibility.
Add a test that would have caught the backwards incompatibility where
project IAM bindings aren't merged, but are overwritten.
2017-02-06 22:27:28 -08:00
Dana Hoffman
576f2231d9 Merge pull request #11548 from zopanix/patch-1
Added forceNew on accessConfig in google_compute_instance_template
2017-02-06 17:19:55 -08:00
Evan Brown
4d2b136a12 providers/google: Fix google_project IAM bug
This changes removes read of the deprecated `policy_data` attr in
the `google_project` resource.

0.8.5 introduced new behavior that incorrectly read the `policy_data`
field during the read lifecycle event. This caused Terraform to
assume it owned not just policy defined in the data source, but
everything that was associated with the project. Migrating from 0.8.4
to 0.8.5, this would cause the config (partial) to be compared to the
state (complete, as it was read from the API) and assume some
policies had been explicitly deleted. Terraform would then delete them.

Fixes #11556
2017-02-06 14:16:22 -08:00
Matthew Frahry
7b053a8e58 Update storage_bucket_acl.html.markdown 2017-02-03 09:26:39 -07:00
Matthew Frahry
c69a8988e7 Update storage_bucket_acl.html.markdown
Removing `default_acl` since Terraform doesn't manage it anymore
2017-02-03 09:09:03 -07:00
Matthew Frahry
ef398e2130 Add test to PR 9320 (#11645) 2017-02-03 11:50:57 +00:00
Dana Hoffman
b6f8934b2c provider/google: only set additional zones on read if it had been set in the config 2017-02-02 17:37:03 -08:00
Dana Hoffman
2ffc1a9f1f Merge pull request #11590 from evandbrown/google-cloud-sql-pw
providers/google: No default root user for SQL
2017-02-01 15:43:23 -08:00