Commit Graph

219 Commits

Author SHA1 Message Date
Dana Hoffman
6d947cd20e Add state migration from disk to boot_disk/scratch_disk/attached_disk (#329)
* Add state migration from disk to boot_disk/scratch_disk/attached_disk

* get rid of test for now

* update schema version

* add tests for migration

* fix travis errors

* actually fix travis errors

* fix logic when project is set, also remove some log statements

* add tests for reading based on encryption key and image

* use as much of the image URL as we can for matching on image

* read project from config if it wasn't set in the attribute

* update resolveImage call
2017-09-28 14:37:03 -07:00
Vincent Roseberry
bc25c02cbf Firewall network field now supports self_link in addition of name (#477) 2017-09-28 12:02:39 -07:00
Vincent Roseberry
39a858894a Remove alias ip range from beta feature for compute subnetwork 2017-09-28 10:48:28 -07:00
Vincent Roseberry
b5e1bf4a82 Remove alias ip range from beta feature for compute instance 2017-09-28 10:48:28 -07:00
Vincent Roseberry
764fb6b86c Rewrite api versions tests as table driven tests (#476) 2017-09-27 15:25:10 -07:00
Dana Hoffman
cc8ea81117 Fix a few instances where we read the project from the provider config and not using the helper function (#469) 2017-09-26 17:01:52 -07:00
Vincent Roseberry
ace5dffcc8 Remove project if it has been deleted from outside of Terraform (#466) 2017-09-26 16:55:32 -07:00
Dana Hoffman
617ad7362b allow min node counts of 0 for node pool autoscaling (#468) 2017-09-26 15:57:51 -07:00
Vincent Roseberry
5874819e21 Remove beta code path in compute_global_address 2017-09-26 15:57:22 -07:00
Vincent Roseberry
d35b92086a global_address ipv6 uses v1 api
global_forwarding_rule ipv6 uses v1 api
Update documentation
2017-09-26 15:57:22 -07:00
Vincent Roseberry
27a99c7dab Don't crash if node config is nil in google_container_cluster (#467) 2017-09-26 15:32:12 -07:00
Joe Selman
8231d6a83a Add resource_logging_billing_account_sink resource (#457)
* Add resource_logging_billing_account_sink resource

* Fix bad style
2017-09-26 15:26:54 -07:00
Vincent Roseberry
5e44df5199 Pubsub subscription read state from API and import support (#456) 2017-09-26 13:44:13 -07:00
Vincent Roseberry
20929eb468 Assign IAM policy to folder. (#447)
* Assign IAM policy to folder.
* Add documentation for google_folder_iam_policy
2017-09-25 11:30:45 -07:00
Paddy
c31bfdc4df Merge pull request #439 from terraform-providers/paddy_undeletable_bucket_acls
Deal with undeletable bucket ACLs in storage.
2017-09-25 10:29:15 -07:00
Paddy
5060f07926 Pull ProjectNumber off bucket, not getProject.
Use the project reported by the bucket, not the one Terraform is
configured to use.
2017-09-25 06:02:36 -07:00
Manoj Srivastava
c1d0e716d9 Folder support: Assign/Reassign a google project to a folder. (#438)
+ Make the org_id optional when creating a project. Closes #131
+ Mark org_id as computed to allow for GCP automatically assigning the org.
+ Add an acceptance test for project creation without an organization.
+ Skip TestAccGoogleProject_createWithoutOrg if GOOGLE_ORG is set.
+ Add a folder_id to the google_project resource, optionally
  specifying the ID of the GCP folder in which the GCP project should
  live.
+ Document how one can provision a project into a folder, and added a
  sample configuration to create a project into an existing folder.
* Skip test without org if service account is used
* Support folders/* or id only for the folder id field
2017-09-22 13:03:08 -05:00
Paddy
a6df85d809 Merge pull request #440 from terraform-providers/paddy_fix_object_acl_predefined
Fix failing test on storage_object_acl.
2017-09-16 16:23:17 -07:00
Paddy
6b1b727449 Fix failing test on storage_object_acl.
The `predefined_acl` test for `storage_object_acl` was failing. This is
because we removed the state-setting portion of the `predefined_acl`
field from `storage_bucket_acl`, and due to what I can only assume is a
copy/paste error, `storage_object_acl` was calling the Read function of
`storage_bucket_acl` instead of its own when using `predefined_acl`.

Updating to use `storage_object_acl`'s Read function makes the tests
pass.
2017-09-15 13:08:37 -07:00
Paddy
b343829d22 Stop fighting with the test framework.
Project number is now set through an environment variable instead of
being inferred at runtime using the API.
2017-09-15 12:53:44 -07:00
Paddy
755edf6d79 Fix make test.
Because we were instantiating a client outside of resource.TestCase, it
was being instantiated even for unit tests, which have no credentials,
causing the unit tests to fail. Sadly, this is the only way I could
figure out how to get a client inside resource.TestCase, which is very
sad making, but works.
2017-09-15 12:28:29 -07:00
Paddy
72114636da Deal with undeleatable bucket ACLs in storage.
When GCS buckets are created, they're created with a set of default
ACLs:

* `OWNER:project-owners-{project_number}`
* `OWNER:project-editors-{project_number}`
* `READER:project-viewers-{project_number}`

Normally, this would be fine, or a minor inconvenience. Terraform could
either delete them itself, or the first apply of a user would overwrite
them.

However, trying to remove the `OWNER:project-owners-{project_number}`
ACL yields an API error that the bucket owner must maintain OWNER access
to the bucket. This breaks things like `terraform destroy`, but also
means any config without that line in it will fail to apply, not just
overwrite the value.

To make matters worse, trying to *add* the
`OWNER:project-owners-{project_number}` ACL to any bucket that already
has it _also_ yields the same error about not being able to remove it.

To get around this, the storage_bucket_acl resource has been updated to
largely ignore _just this_ ACL. It will not try to add it if it already
exists, will not try to remove it at all. This does mean that Terraform
is incapable of removing this ACL from a bucket, but I'm not sure it's
possible to do that with the API, anyways.

Tests were also updated to keep the default ACLs as part of the config,
and to change the email addresses to addresses we actually own. I tried
changing to non-existant hashicorp.com email addresses, but was
rejected; only email addresses that are backed by actual Google accounts
can be used, sadly.
2017-09-15 12:03:03 -07:00
Christopher Stelma
43e749c213 Add versioning for google storage buckets (#381) 2017-09-15 08:36:01 -07:00
Joe Selman
3d5eccc1c6 Add stackdriver project sink support (#432)
* Vendor cloud logging api

* Add logging sink support

* Remove typo

* Set Filter simpler

* Rename typ, typName to resourceType, resourceId

* Handle notFoundError

* Use # instead of // for hcl comments

* Cleanup test code

* Change testAccCheckLoggingProjectSink to take a provided api object

* Fix whitespace change after merge conflict
2017-09-14 19:15:14 -07:00
Vincent Roseberry
167abea500 Create, update, move and delete a GCP folders. (#416)
* Initialize resourcemanager v2beta1 client
* Create new google_folder resource supporting create, move, update and delete operations.
* Add documentation for folders
2017-09-14 11:19:58 -07:00
Vincent Roseberry
3859f643f1 Renaming cluster import test to match other acceptance tests naming scheme (#434) 2017-09-14 11:02:00 -07:00
Raúl Naveiras
eee011fc99 Add support for setting labels to google_project (#383) 2017-09-14 10:39:21 -07:00
Dana Hoffman
5f86f52d1f Add DiffSuppressFunc to GKE cluster networks (#419)
* fix gke network test
* use a state func to store the resource name
2017-09-14 09:36:29 -07:00
Joe Selman
68303edb42 Fix error message not getting expanded properly. (#430) 2017-09-14 09:30:06 -07:00
Vincent Roseberry
3027822917 Instance group manager cleanup (#409) 2017-09-13 17:06:07 -07:00
Vincent Roseberry
137485ae4f computeBetaOperationWaitTime doesn't use the timeoutMin properly (#425) 2017-09-13 16:29:50 -07:00
Vincent Roseberry
870f456ef9 Save name-only instead of link path in pubsub_topic (#424) 2017-09-13 16:29:26 -07:00
Joe Selman
41248230ef Expose instance_id as a computed field on compute_instance (#427) 2017-09-13 16:18:08 -07:00
Vincent Roseberry
f83618624c Save region name-only instead of the self-link in compute_address (#422) 2017-09-13 09:51:32 -07:00
Dana Hoffman
2d733a1600 Add new google_compute_shared_vpc resource (#396)
* Revendor compute apis

* Add new resource for shared VPC host

* add test for disabled

* add docs for shared vpc host resource

* make project required

* Add new resource google_compute_shared_vpc

* Remove google_compute_shared_vpc_host

* Add docs for shared vpc resource

* Remove docs for shared vpc host resource

* fix typos in shared vpc docs

* move helper fn to utils.go
2017-09-13 10:36:07 +08:00
Joe Selman
204201a5be Refactor tests to defer to common method when looking up project (#410) 2017-09-12 13:28:31 -07:00
Joe Selman
7206284739 Add support for labels to compute_global_forwarding_rule (#395)
* Add support for labels to compute_global_forwarding_rule

* Factor out label api methods and use case statement for api version
2017-09-12 08:06:40 -07:00
Joe Selman
7dea4e86c1 Export connection_name on sql instance resource (#406) 2017-09-12 08:04:13 -07:00
Paddy
26ec7e04f7 Merge pull request #358 from terraform-providers/paddy_storage_bucket_acl
storage: make bucket ACLs control the entire resource.
2017-09-11 13:51:12 -07:00
Vincent Roseberry
a42d59b2c5 Use common utils method in iam policy data source (#405) 2017-09-11 12:43:44 -07:00
Anders Bruun Olsen
bf51f26c07 Pubsub importable (#392) 2017-09-11 09:46:27 -07:00
Vincent Roseberry
c751a32626 Add new resource region_instance_group_manager (#394) 2017-09-08 17:02:32 -07:00
Vincent Roseberry
7ceea51dfd Add support for alias_ip_range in google_compute_instance network interface (#375) 2017-09-07 13:43:00 -07:00
Joe Selman
5cd3e1ec99 Write entire backend service resource when updating (#364)
Also update the default value for connection_draining_timeout_sec to
match the default used by GCP
2017-09-07 12:56:53 -07:00
Joe Selman
84fa7ccd27 Don't attempt to delete default users on replica (#360)
* Don't attempt to delete default users on replica

* Test that we don't attempt to delete root user on replica
2017-09-07 12:44:17 -07:00
Vincent Roseberry
5be9d28369 Import for compute_address supports multiple id formats. (#378)
This allows to import address from region and project different than the default project.
2017-09-07 10:38:26 -07:00
Anders Bruun Olsen
67b7b2dd72 Container cluster importable (#391) 2017-09-07 10:31:58 -07:00
Dana Hoffman
333c2f09db Fix bug with CSEK where the key stored in state might be associated with the wrong disk (#327)
* Fix bug with CSEK where the key stored in state might be associated with the wrong disk

* preserve original order of attached disks

* use the disk index to figure out the raw key
2017-09-07 22:04:26 +08:00
Kit Ewbank
0858e7cd2d Add google_client_config data source (#385) 2017-09-06 14:52:32 -07:00
Vincent Roseberry
b082eb0b65 Remove duplicate []interface{} to []string method (#388) 2017-09-05 14:37:02 -07:00