Commit Graph

522 Commits

Author SHA1 Message Date
Alberto
d1305e989a add test for resource_google_project_iam_policy (#698) 2017-11-08 09:26:32 -08:00
Vincent Roseberry
ff184b8d67
Add support to google_compute_target_pool for health checks self_link (#702)
- Accepts self_link in addition of health check name
- Removes the need for an API call to generate the self link
- Improves the documentation to mention that only the legacy google_compute_http_health_check is supported. This will prevent our user from being stuck like mentioned here: #300.
- Adds a MaxItems:1 in the schema. You can't have more than one. The API will fail. The official docs also says so.
- Adds a check to the acceptance test to ensure the health checks are properly setup.
2017-11-08 09:11:17 -08:00
Paddy
8b2486cd15
Merge pull request #359 from terraform-providers/paddy_95_dns_ns
dns: Add special handling for ns records.
2017-11-07 16:46:38 -08:00
Paddy
4a342ca8ee Add comment for create func.
Add a comment explaining why we have such wonky update logic in the
create func for NS record sets.
2017-11-07 16:42:25 -08:00
Michael Bannister
12060f9f3d Add support for maintenance window on google_container_cluster (#670)
* Add support for maintenance window on google_container_cluster (#526)

* Address review comments

- Set ForceNew: true on the schema element daily_maintenance_window
- Correct resource name in acceptance test
- Correct documentation of resource attribute maintenance_policy.0.daily_maintenance_window.0.duration
2017-11-07 15:42:11 -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
af0a22fbfb Make google_logging_project_sink resource importable (#688) 2017-11-07 14:40:22 -08:00
Nic Cope
20fc7cf077 Give addresses beta support, add internal addresses (#594) 2017-11-07 13:38:26 -08:00
Dana Hoffman
7f9f7201a8
make setFields a list of regexps (#696) 2017-11-07 11:27:05 -08:00
Alberto
8faee72655 add support provider project on resource_google_project_iam_policy.go (#691)
* add support provider project on resource_google_project_iam_policy.go
* add specific test for iam policy with default project
2017-11-06 13:27:20 -08:00
Nic Cope
96db217168 Add secondary range support to google_compute_subnetwork data source (#687)
..and throw in project and region while we're at it.
2017-11-06 11:19:46 -08:00
Sébastien GLON
b9eac810c9 correct issue #684 (#686) 2017-11-06 10:56:10 -08:00
Dana Hoffman
4a499b2f7d
Add support for source/target service accounts to google_compute_firewall (#681)
* add source/target service accounts to firewalls

* firewall service account docs
2017-11-06 09:34:48 -08:00
Dana Hoffman
1b8f450cb3
Update google_compute_target_pool to no longer have a plan/apply loop with instance URLs (#666)
* Using instance URLs in `google_compute_target_pool` no longer has a plan/apply loop

* global regex; parts length check
2017-11-03 17:02:02 -07:00
Dana Hoffman
f68765f5cd
Fix bug with empty initialize_params block (#664)
* fix initialize params bug

* make sure all init params are deleted, not just #
2017-11-03 15:25:54 -07:00
Dana Hoffman
49a91427b4
check for sets in node pool tests (#661) 2017-11-03 15:07:01 -07:00
Dana Hoffman
794d971695
make dataproc tests parallel and use service account resource (#660) 2017-11-03 15:05:20 -07:00
Dana Hoffman
0668525e5c
increase timeout for deleting networks (#662) 2017-11-03 11:08:54 -07:00
Dana Hoffman
51ed0b74dd
Allow attaching and detaching disks from instances (#636)
* allow updating attached disks

* check for scratch and update comment
2017-11-02 13:08:02 -07:00
David Quarles
ca7551c8c5 Add support for master authorized networks in google_container_cluster (#626)
* Add support for master authorized networks in `google_container_cluster`

* [review] remove enabled flag / restructure schema

- remove `google_container_cluster.master_authorized_networks_config.enabled`
- add `display_name` and restructure schema as follows:
    master_authorized_networks_config {
        cidr_blocks {
            cidr_block   = "0.0.0.0/0"
            display_name = "foo"
        }
    }
- amend tests

* [review] add test for validateRFC1918Network, fix acc test
2017-11-02 10:38:20 -07:00
Henry Bell
026d76616d Add support for Kubernetes alpha features (#646)
* Add support for Kubernetes alpha features

* Add tests for support of Kubernetes alpha features

* Fix dodgy copy and paste operations

* Add documentation
2017-10-31 16:38:18 -07:00
Antonio Lobato
d37f352f41 Add IAP support for backend services (#471)
* initial work on adding IAP support for backend services

* readback of IAP

* flatten IAP + static set id

* expandIap function

* removed enabled flag/state rework

Removed the enabled flag for IAP
IAP is now enabled when the client id and secret are set
IAP now correctly disables when IAP stanza is removed
Client secret is now correctly hashed against the secret hash stored on the server

* Tests for IAP

* added comments, fixed tabs.

* testing for IAP disabled
2017-10-31 16:27:03 -07:00
Paddy
c882a77db6
Merge pull request #399 from terraform-providers/vendor-tf-0.10.3
Remove 'id' fields from schemas
2017-10-31 16:10:45 -07:00
Vincent Roseberry
0332208bc9
Add import support to global forwarding rule (#653) 2017-10-31 11:28:55 -07:00
Paddy
ac73bebb15
Rename instead of removing.
Rename all ID fields to {resource_noun}_id instead of removing them
outright. This means people can still get at the info.

Leave project's id deleted. It has been marked as Removed for months.
I'm fine with cleaning it up before 1.0.0.

Also, update website docs.
2017-10-31 16:27:37 +00:00
Radek Simko
c3da024d7e
Remove 'id' fields from schemas 2017-10-31 16:27:36 +00:00
Nicki Watt
96ac8fc8a4 Add google_dataproc_cluster resource (#252)
* Add google_dataproc_cluster resource

* Add google_dataproc_cluster tests

* Add google_dataproc_cluster docs

* Removed google_dataproc_job ref (to be added in separate PR)

* Added delete_autogen_bucket attribute

* Refactored / simplified wait mechanism

* Changes based on review

* go fmt

* Add  cluster_config enclosing config block

* Review updates - primarily re restructuring hierarchy

* Removed rogue import

* docs - alignment

* Changes for review

* Refactoring into expandXXX methods

* Refactoring of flattenXXX methods to be explicit
2017-10-30 16:41:37 -07:00
Dana Hoffman
7b69c31f6a
Add labels to google_storage_bucket (#652)
* revendor storage

* revendor gensupport

* revendor bigquery

* add support for storage bucket labels

* bucket label docs
2017-10-30 15:48:26 -07:00
sebasrobert
d3b8482388 Subscription with topic in different project (#640)
Right now we can't create subscription on a topic in a different gcp
project since it assume the project from the subscription. The provider
always create the full topic name string
projects/{project}/topics/{topic} with the received topic property.
Using a regexp we validate if the string is already in
the format projects/{project}/topics/{topic} and if it's the case
we don't wrap it again and take it directly. The original functionality
is maintained but it's possible to specify a different project for the
topic.
2017-10-30 13:12:14 -07:00
Dana Hoffman
adbb5dd4fb
Update GKE docs to match actual schema; reorder fields in schema (#637)
* reorder schemas and update docs

* initial_node_count is optional

* clarify when initial_node_count must be set
2017-10-27 15:18:34 -07:00
Dana Hoffman
48192d62dc
Quick simplification for resource_compute_firewall logic (#631)
* simplify firewall logic

* fix whitespace
2017-10-27 15:08:22 -07:00
Michael Parker
f2fc78d082 Adds support for creating KMS KeyRing resources (#518)
* Instantiate the cloudkms client

* Implement Create and Read for the kms key ring resource

* Expose the kms key ring resource

* Create acceptance test for creating a KeyRing, fix read to use KeyRing ID

* Add cloudkms library to vendor

* Address style comments

* Use fully-qualified keyring name in read operation

* Remove call to SetId during read operation

* Set ID as entire resource string

* Spin up a new project for acceptance test

* Use Getenv for billing and org environment variables

* And test and logs around removal from state

* Add comments

* Fixes formatting

* Log warning instead of info

* Use a single line for cloudkms client actions

* Add resource import test

* Add ability to import resource, update helper functions to use keyRingId struct

* Use shorter terraform ID for easier import

* Update import test to use the same config as the basic test

* Update KeyRing name regex to be consistent with API docs

* Add documentation page for resource

* Add KeyRing documentation to sidebar

* Adds unit tests around parsing the KeyRing import id

* Allow for project in id to be autopopulated from config

* Throw error in import if project provider is not provided for location/name format

* Consistent variable names

* Use tabs in resource config instead of spaces

* Remove "-x" suffix for docs

* Set project attribute on import if different from the project config
2017-10-27 09:40:01 -07:00
David Quarles
1a8f3b8d18 Add support for CPU Platform in google_container_node_pool (#622)
* update container/v1 API

* add support for CPU Platform in `google_container_node_pool`

* fix broken links
2017-10-25 14:08:48 -07:00
Sébastien GLON
1f954e0131 Add sort on google_container_cluster auth_scopes (#506)
* replalce TypeList by TypeSet

* Add migrate function and test

* CORRECT

* remove migrate

* fix tests
2017-10-25 13:41:42 -07:00
Sébastien GLON
94e0b746df Add support for google_service_account_key (#472)
* Initial support for google service account keys

* Add vendor for vault and encryption

* Add change for PR comment

* Add doc and improvement fo public key management

* adding waiter for compatibility with issue google/google-api-go-client#234

* improvement

* Add test with pgp_key

* Perform doc anf format

* remove test if public_key exists

* Add link on doc

* correct pr
2017-10-25 12:43:20 -07:00
Patrick Decat
3d1e11023d Make google_service_account resource importable (#606)
* Make google_service_account resource importable

* Add google_service_account testcase with default project

* Mark google_service_account.project as computed to ensure the project id is always stored in the state, defined in configuration or not. Add corresponding test cases

* Inline variables with single usage

* Replace tabs with spaces in configuration strings

* Ensure service account is not recreated when the default project is explicitely added to the configuration

* camelcase
2017-10-25 12:33:21 -07:00
Paddy
0e2fa2e38f Address comments.
Fix typo, add log line, and document what we're doing on the website.
2017-10-24 14:43:35 -07: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
Dana Hoffman
c577ad6e8d Allow setting boot and attached disk sources by name or self link (#605)
* disk cleanup

* fix attached disk test

* allow disk sources from name or url

* parse disk source better on read

* update docs

* fix boot disk source url
2017-10-23 13:26:59 -07:00
Dana Hoffman
be0525885e post-migration disk cleanup (#600)
* disk cleanup

* fix attached disk test
2017-10-23 12:53:41 -07:00
Dana Hoffman
3a442a81a2 add prefix to instance name (#593) 2017-10-20 09:48:00 -07:00
Dana Hoffman
7c2bf7f4a7 make addons_config updatable (#597) 2017-10-20 09:47:07 -07:00
Dana Hoffman
62eb5ceedf Allow updating google_container_cluster.monitoring_service (#598) 2017-10-20 09:46:21 -07:00
Dana Hoffman
081e675d3d migrate boot disk initialize params (#592) 2017-10-20 09:45:05 -07:00
Joe Selman
2765290724 Add label support to google_compute_snapshot (#570)
* Add label support to google_compute_snapshot
* Refactor operation polling code to use client directly
2017-10-13 15:36:03 -07:00
Vincent Roseberry
3f3fa868c7 Fix import for compute_route (#565)
* Reorder fields in schema for style consistency
* Add reusable ZonalFieldValue
* Fix import and read state from API for compute route
* Generate network link without calling the API
2017-10-13 11:05:22 -07:00
Vincent Roseberry
66f876e6ae Add new resource google_compute_target_ssl_proxy (#569)
* Add target ssl proxy
* Add documentation
2017-10-13 11:02:42 -07:00
Radek Simko
25869fa5c8 Merge pull request #567 from terraform-providers/f-ds-lb-ip-ranges
d/compute_lb_ip_ranges: Add new data source
2017-10-13 07:09:09 +01:00
Joe Selman
4b77dca918 Revert "Revert "Add t.Parallel to all acceptance tests (#558)""
This reverts commit 8ab9d96d25 and revives
the original commit that adds t.Parallel to all acceptance tests. It
turns out test failures were unrelated to this change (rather, they were
related to quota issues).
2017-10-12 15:07:29 -07:00
Dana Hoffman
811530f145 Fix cluster version upgrades (#577)
* wait for running status on a cluster on read

* add min_master_version field

* respond to comments

* add docs

* no node_version on create
2017-10-12 11:21:33 -07:00
Dana Hoffman
ea909a3409 Change group back to Optional in google_compute_backend_service (#576)
* change group back to optional

* fix build
2017-10-12 09:21:35 -07:00
Paddy
0183e26999 Give bucket unique name in tests.
This will stop the test failure from the dangling resource.
2017-10-11 16:52:37 -07:00
Peter Milley
fe01f7fdd6 Copy network_interface attributes to Terraform state. (#536) 2017-10-11 13:33:58 -07:00
Vincent Roseberry
eb88e6d40d Fix org policies update test to actually update instead of doing a create/delete/create/delete cycle (#573) 2017-10-11 13:31:24 -07:00
Vincent Roseberry
e5d9fe6163 Add support for shared VPC (#572)
* Add VPC host project resource
* Add VPC service project resource
* Add combined acceptance test for shared VPC
* Add docs for shared VPC
* Increase deadline for project services operation
2017-10-11 12:51:09 -07:00
Joe Selman
8ab9d96d25 Revert "Add t.Parallel to all acceptance tests (#558)"
This reverts commit 42de44592f. It appears
there might be thread-safety issues as panics have started occuring when
parallism is ramped up. Reverting for now while investigating.
2017-10-10 17:55:34 -07:00
Joe Selman
42de44592f Add t.Parallel to all acceptance tests (#558) 2017-10-10 16:28:00 -07:00
Radek Simko
80ca6c26b1
d/compute_lb_ip_ranges: Add new data source 2017-10-10 22:07:21 +01:00
Radek Simko
31dc9d3790 Merge pull request #566 from terraform-providers/b-inst-tpl-device-name-computed
r/compute_instance_template: Make disk.device_name computed
2017-10-10 20:37:26 +01:00
Radek Simko
8378b58bdf
r/compute_instance_template: Make disk.device_name computed 2017-10-10 19:43:59 +01:00
Radek Simko
96ac8255d1 Merge pull request #561 from terraform-providers/f-compute-vpn-tunnel-secret-sensitive
r/compute_vpn_tunnel: Mark 'shared_secret' as sensitive
2017-10-10 18:24:33 +01:00
Radek Simko
44f477326d Merge pull request #560 from terraform-providers/b-ds-dns-mz-404
d/dns_managed_zone: Error out if zone is not found
2017-10-10 18:21:56 +01:00
Vincent Roseberry
45c1d723e5 Create a reusable GlobalFieldValue and support reading project from schema (#550) 2017-10-10 09:53:57 -07:00
Radek Simko
4bbce17bee
d/dns_managed_zone: Error out if zone is not found 2017-10-10 13:13:42 +01:00
Radek Simko
0e5b4b0597
r/compute_vpn_tunnel: Mark 'shared_secret' as sensitive 2017-10-10 12:57:52 +01:00
Vincent Roseberry
3d4c517ce8 Fix crash because missing error check before waiting on operation (#556) 2017-10-09 14:12:05 -07:00
Scott Stevenson
d574c6a910 Add resource_compute_region_autoscaler (#544)
* Add resource_compute_region_autoscaler
* Add import acceptance tests, reuse zonal autoscaler code
* Enforce single autoscaling policy requirement at terraform plan time
2017-10-09 10:59:38 -07:00
Joe Selman
e3ca8fbe59 Add labels to google_compute_instance_template (#515) 2017-10-09 10:17:15 -07:00
Dana Hoffman
d67bf7b3fc add master_version to container cluster (#538) 2017-10-06 15:48:01 -07:00
Vincent Roseberry
306b3d66b4 Forwarding rule network field supports name in addition of self_link (#487)
* Forwarding rule network field supports name in addition of self_link
* Update documentation
2017-10-06 09:33:42 -07:00
Vincent Roseberry
c94cbde1f6 Add import support to google_compute_target_tcp_proxy (#534) 2017-10-05 14:29:53 -07:00
Vincent Roseberry
87f3a58cb2 Add support for org policies at the organization level (#523)
* Fetch latest resource manager client
* Add new resource to manage Org Policy at the organization level.
* Update documentation
2017-10-05 13:20:16 -07:00
Alberto
2f94ff9ad4 Add support for target_tcp_proxy (#528) 2017-10-05 10:27:56 -07:00
Dana Hoffman
754e6daceb Fix BackendService group hash when instance groups use beta features (#522)
* change backend hash function

* update if statement
2017-10-04 16:49:02 -07:00
Dana Hoffman
5b3bd3455c Fix crash when creating node pools with name_prefix (#531) 2017-10-04 16:41:35 -07:00
Vincent Roseberry
0ba267dafc Use NetworkFieldValue in google_compute_subnetwork (#529) 2017-10-04 15:21:49 -07:00
Vincent Roseberry
10aeb9cd47 Improve VPN gateway and router to generate network link without calling network API (#527)
* Router network fields supports name in addition of self_link
* Improve VPN Gateway network field support
2017-10-04 14:01:38 -07:00
Dana Hoffman
bb0ab8e1f6 Merge the schemas and logic for the node pool resource and the node pool field in the cluster to aid in maintainability (#489) 2017-10-03 17:09:34 -07:00
Vincent Roseberry
e9436964bd Network peering gets network project from network self_link (#498) 2017-10-03 13:30:31 -07:00
Vincent Roseberry
7d65b3ed04 Firewall uses v1 API if the priority is unset or has the default value. (#500)
* api_versions supports default value
* Firewall use v1 API if the priority is set to default value (1000)
2017-10-03 13:24:02 -07:00
Vincent Roseberry
5f887b6568 Add update support for pubsub subscription push config field (#512) 2017-10-03 13:14:51 -07:00
Dana Hoffman
2db85e8e75 Add new retry wrapper fn, retry sql database instance operations that commonly 503 (#417)
* Retry sql database instance operations that commonly 503

* use new retry wrapper fn in resource_storage_bucket.go
2017-10-03 12:41:04 -07:00
Joe Selman
475ddb1b5b Add kubernetes dashboard addon (#464)
* Update google.golang.org/api/container/v1

* Add support for kubernetes_dashboard addon

* Fix tab/spaces issue in string
2017-10-03 09:29:27 -07:00
Joe Selman
ef543b20c5 Add google_logging_folder_sink resource (#470)
* Fix bad page title

* Add resource logging_folder_sink

* Use proper parse function and string format

* Remove unused strings
2017-10-03 09:26:19 -07:00
Paddy
33b526aa10 Skip migrations if we're not running acc tests. 2017-10-02 12:49:49 -07:00
Paddy
300bae3244 Fix compute_instance migration bug.
`compute_instance`'s StateVersion was set to 2. Then we released a
migration to v3, but never updated the StateVersion to 3, meaning the
migration was never run. When we added the migration for disks, we
bumped to 4, bypassing 3 altogher. In theory, this is fine, and is
expected; after all, some people may have state in version 0 and need to
upgrade all the way to 4, so our schema migration function is supposed
to support this.

Unfortunately, for migrations to v2, v3, and v4 of our schema, the
migration _returned_ after each migration, instead of falling through.
This meant that (in this case), version 2 would see it needs to be
version 4, run the state migration to version 3, then _return_, setting
its StateVersion to _4_, which means the migration from 3->4 got skipped
entirely.

This PR bumps the version to 5, and adds a migration from 4->5 such that
if there are still disks in state after 4, re-run 4. This will fix
things for people that upgraded to 1.0.0 and had their StateVersion
updated without the migration running.

I also updated the tests @danawillow wrote to start from state version 2
instead of state version 3, as the state would never be in version 3.

I also duplicated those tests, but started them from state version 4
(assuming the migration hadn't run) and verifying that the migration
from 4->5 would correct that.
2017-10-02 12:34:09 -07:00
Dana Hoffman
bbad89afe6 Fix failing tests: instance templates still use disk (#504)
* instance templates still use the disk field

* more fixes
2017-09-30 19:42:15 -07:00
Paddy
fccae61d61 1.0.0 Deprecations, pt 2
Fix the CI tests we broke with the deprecations for 1.0.0, and update
the docs we missed. Also, update the examples.
2017-09-29 16:04:52 -07:00
Paddy
3db816d686 Merge pull request #491 from terraform-providers/paddy_1.0_deprecations
Remove deprecated resources for 1.0.0.
2017-09-29 11:32:14 -07:00
Paddy
136a176e7e Deprecate disable_project on google_project_iam_policy. 2017-09-29 11:13:44 -07:00
Paddy
fe83578d33 Merge pull request #494 from terraform-providers/paddy_revert_shared_vpc
Revert Shared VPC.
2017-09-29 09:53:16 -07:00
Paddy
02512af271 Revert Shared VPC.
We want to talk about the design of Shared VPC a little bit more before
it ships, so this PR removes it, to be added back at a later date.
2017-09-29 04:59:41 -07:00
Paddy
50ad10a513 Address comments. 2017-09-29 04:57:47 -07:00
Paddy
b1fa2a4702 AccTest fixes. 2017-09-29 04:54:24 -07:00
Dana Hoffman
f31e34cad9 Mark certificate as sensitive within google_compute_ssl_certificate (#490) 2017-09-28 17:45:36 -07:00
Paddy
e4d920b774 Remove disks field. 2017-09-28 17:22:29 -07:00
Paddy
5aca4468ac Update tests that use deprecated resources. 2017-09-28 17:08:55 -07:00
Paddy
edad00bf4b Replace variable we actually needed. 2017-09-28 15:44:21 -07:00
Paddy
19b2a3550a Undelete initial_node_count.
This was just deprecated recently, don't remove it.
2017-09-28 15:40:24 -07:00
Paddy
a76fa3bd6a Merge branch 'master' into paddy_1.0_deprecations 2017-09-28 15:37:19 -07:00
Paddy
a586429bd7 Deprecate our authoritative stuff. 2017-09-28 15:36:40 -07:00
Paddy
f2f276ea0b Remove deprecated resources for 1.0.0.
In advance of 1.0.0, let's take the opportunity to remove the fields on
resources that have been deprecated for a while.
2017-09-28 14:38:38 -07:00
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
Joe Selman
0605638885 Add preemptible as an option to node config (#341)
* Add preemptible as an option to node config

* Check for preemptible in test matching functions

* Move flattenClusterNodeConfig to node_config

* Handle bools properly when comparing in cluster and node pool tests

* Use a supported image_type in cluster tests
2017-09-01 13:02:26 -07:00
Vincent Roseberry
c2399f76fb Add support for min_cpu_platform in google_compute_instance. (#349) 2017-08-30 17:25:31 -04:00
Joe Selman
6377443d4a Add ability to set priority on compute_firewall (#345)
* Add ability to set priority on compute_firewall

* Set the priority explicitly when upgrading v1->v0beta
2017-08-30 12:19:50 -07:00
James McGill
d23e9c668f Support Bigquery Views (#230)
* Support views in Terraform.BigQuery

* Add tests for Table with view, and fix existing Table test

* Remove dead code

* run gofmt

* Address comments

* Address review comments and add support for use_legacy_sql

* Force transmission/storage of UseLegacySQL

* Trying to fix tests

* add tests for useLegacySQL
2017-08-26 17:15:44 +09:00
Joe Selman
b29337dbfb Fix bug where flattened ip_address had extra empty element (#357)
The combination of append and preallocation of the ips caused extra
empty elements at the beginning of the list.
2017-08-25 09:13:37 -07:00
Paddy
b2ff683868 dns: Add special handling for ns records.
Cloud DNS requires every managed zone to have an NS record at all times.
This means if people want to manage their own NS records, we need to add
their new record and remove the old one in the same call. It also means
we can't delete NS records, as we wouldn't know what to replace it with.
So deleting of NS records short-circuits. For the case of `terraform
destroy`, this prevents the error. It does mean if the user explicitly
tries to remove their NS zone from their project, it silently does
nothing, but that's unavoidable unless we want to A) restore a default
value (and it looks like the default values change from zone to zone?
And that is arguably just as unexpected?) or B) let the (arguably more
reasonable) `terraform destroy` case be impossible.
2017-08-25 02:08:35 -07:00
Paddy
5b6df5ee93 storage: make bucket ACLs control the entire resource.
Storage bucket ACLs inherited the behaviour of only updating the fields
that were set in the config file. Terraform should track all the fields
in the resource, whether the user has specified a value for them or not,
and correct any drift that may occur.

This has manifested in an issue and unexpected behaviour in #50, and
this PR restores the expected behaviour.
2017-08-24 16:18:34 -07:00
Vincent Roseberry
7a216c40b5 Add support for guest_accelerators (GPU) to google_compute_instance (#330) 2017-08-22 15:49:43 -04:00
Joe Selman
772a5f28f9 Add labels to google_compute_disk (#344)
* Remove redundant '(Computed)' text

* Add support for setting labels on compute_disk

* Fix minor spacing issue in test
2017-08-18 16:10:47 -07:00
Dana Hoffman
07cf281372 allow updating google_container_cluster.logging_service (#343) 2017-08-18 15:29:51 -07:00
Joe Selman
227ea5660f Add support for setting labels to compute_image (#339) 2017-08-18 13:34:11 -07:00
Dana Hoffman
4cbc859de3 Add support for resizing a node pool defined in google_container_cluster (#331)
* Add support for resizing a node pool defined in google_container_cluster

* add initial node count back but make it deprecated
2017-08-17 17:51:58 -07:00
Joe Selman
329a25848b Move non-provider related functions into a utils.go file (#325) 2017-08-15 16:35:46 -07:00
Paddy
f792923505 Merge pull request #238 from z1nkum/snapshot-fix-url-to-name
Fix google_compute_disk created from snapshot, forces new resource then apply once more
2017-08-15 14:45:14 -07:00
Joe Selman
bcaa151cfa Add support for Google RuntimeConfig (#315)
* Vendor runtimeconfig

* Add support for RuntimeConfig config and variable resources

This allows users to create/manage Google RuntimeConfig resources and
variables. More information here:
https://cloud.google.com/deployment-manager/runtime-configurator/

Closes #236

* Remove typo

* Use top-level declaration rather than init()

* Cleanup testing-related code by using ConflictsWith

Also adds better comments around how update works
2017-08-14 14:16:11 -07:00
Nicki Watt
752b406783 Add Google Spanner Support (google_spanner_database) (#271) 2017-08-14 09:53:11 -07:00
Vincent Roseberry
31afabb864 Rename spanner instance import tests to match format of resource tests (#324) 2017-08-14 09:47:02 -07:00
Nicki Watt
04b3ffb8ea Add Google Spanner Support (google_spanner_instance) (#270) 2017-08-14 09:30:41 -07:00
Dmitry Vlasov
d0b7fbc12f update snapshot test (add case with name reference) 2017-08-12 21:47:18 +03:00
Vincent Roseberry
9c159c6a96 Change required fields to computed in compute instance group datasource (#323) 2017-08-11 15:49:45 -07:00
Riley Karson
5645f72996 Add support for instance_type to google_bigtable_instance. (#313)
* govendor fetch cloud.google.com/go/bigtable

* Vendor the rest of the stuff.

* Add support for instance_type to google_bigtable_instance.

* Revendored some packages.

* Removed bad packages from vendor.json
2017-08-11 14:43:00 -07:00
Roberto Jung Drebes
5602218586 allow configuring node_config of node_pools specified in container_cluster (#299) 2017-08-11 12:23:17 -07:00
Joe Selman
e0e9b3a4d7 Remove default value for removed value automatic_restart (#321)
Import tests for compute_instance_template fail without this change as
they expect a value of true for automatic_restart. As this value was
removed, we're no longer setting it (and therefore it looks like it has
a value of false, which is different from the default).
2017-08-11 10:46:30 -07:00
Aleksandr Didenko
99b43ac400 Add compute instance group data source (#267) 2017-08-11 10:17:36 -07:00
Riley Karson
5c71655bac Changed zone name to be read correctly in google_compute_disk. (#320) 2017-08-10 13:41:27 -07:00
Riley Karson
ff8bdc9b52 Remove Beta operation waiting code and just wait at v1 instead. (#319) 2017-08-10 13:01:56 -07:00
Riley Karson
9e76fab11b Convert old validation functions to use IntAtLeast from helper/validation. (#312)
* Convert old validation functions to use IntAtLeast in helper/validation.

* make fmt

* Remove unused import.
2017-08-10 13:01:45 -07:00
Riley Karson
39423dd063 Stop shadowing err in version switches by using = over := (#318) 2017-08-10 10:29:18 -07:00
Vincent Roseberry
52daf4097a Add subnetwork secondary ip ranges beta feature (#310) 2017-08-09 15:02:54 -07:00
Joe Selman
f9d0570168 Fix scheduling automatic restart, remove deprecated options (#248)
* Fix bug where scheduling.automatic_restart false is never used

* Remove deprecated automatic_restart value in favor of scheduling.automatic_restart

* Remove deprecated on_host_maintenance

* Correct bad var name

* Re-add removed schema values and marked as Removed

* Fix var to snake case

* Migrate empty scheduling blocks in compute_instance_template

* Shorten error message

* Use only one return value instead of two
2017-08-09 12:25:16 -07:00
Stefan Schmidt
caeb43e39a Mark google_sql_database.{charset,collation} as computed instead of having defaults (#229)
* Mark google_sql_database.{charset,collation} as computed instead of having defaults.

This change is required to avoid the following scenario:
When upgrading from a previous version of the Google provider, TF will change
the charset/collation of existing (TF-managed) databases to utf8/utf8_general_ci
(if the user hasn't added different config values before running TF apply),
potentially overriding any non-default settings that the user my have applied
through the Cloud SQL admin API. This violates POLA.

* Remove charset/collation defaults from the documentation, too.

* Add links to MySQL's and PostgreSQL's documentation about supported charset and collation values.

* Use version 5.7's docs instead of 5.6, since that's the most up to date version of MySQL that we support.

* Add a note that only UTF8 / en_US.UTF8 are currently supported for Cloud SQL PostgreSQL databases.
2017-08-08 14:32:16 -07:00
Riley Karson
89ce4d92e4 Add Beta support for egress/direction to google_compute_firewall. (#306)
* Add Beta support for direction to google_compute_firewall.

* Added docs.
2017-08-08 13:28:49 -07:00
Joe Selman
73ef33191d Allow specifying resource name for project metadata item config in tests (#305) 2017-08-08 13:05:13 -07:00
Dana Hoffman
e9e9f835ec Allow upgrading GKE versions and provide better error message handling (#291)
* Better error handling for GKE operations

* Handle GKE version upgrades

* clarify log message
2017-08-08 11:31:12 -07:00
Riley Karson
2d0d8bdcc0 Add Beta support & Beta feature deny to google_compute_firewall (#282)
* Add versioned Beta support to google_compute_firewall.

* Add Beta support for deny to google_compute_firewall.

* remove extra line:

* make fmt

* Add missing ForceNew fields.

* Respond to review comments testing functionality + reducing network GET to v1
2017-08-07 13:14:35 -07:00
Vincent Roseberry
c9e2ce7f08 Change google_container_node_pool ID format to zone/cluster/name to remove artificial restriction on node pool name across clusters (#304) 2017-08-07 12:52:02 -07:00
Anders Bruun Olsen
f06970c97a Make google_container_node_pool resources importable. (#284) 2017-08-07 10:35:39 -07:00
Dmitry Vlasov
2f5ad2492b change request, use DiffSuppressFunc for image and snapshot properties (+fmt) 2017-08-05 22:45:20 +03:00
Dmitry Vlasov
9950c6d1d0 change request, use DiffSuppressFunc for image and snapshot properties 2017-08-05 22:39:30 +03:00
Vincent Roseberry
018e01887b Fail if both name and name_prefix are set for node_pool in google_container_cluster (#296) 2017-08-04 15:34:02 -07:00
Vincent Roseberry
1480539c82 Remove ConflictsWith for network and subnetwork. More than one interface is supported and ConflictsWith doesn't support List properly (#294) 2017-08-04 14:22:04 -07:00
Riley Karson
a4e1083fd1 Add a test that multiple nics work in google_compute_instance. (#289)
* Add a test that multiple nics works in google_compute_instance.

* Add note that multiple nics is in Beta.
2017-08-04 14:18:07 -07:00
Vincent Roseberry
3fde8cf24e google_compute_instance can specified the subnetwork using a self_link (#290) 2017-08-04 11:00:45 -07:00
Riley Karson
68f2e3528c Add Beta support & Beta feature ip_version to google_compute_global_address (#250)
* Make google_compute_global_address a versioned resource with Beta support.

* Added Beta support for ip_version in google_compute_global_address.

* Move checks to TestCheckFuncs, add a regression test for IPV4 on v1 resources.

* Consolidated TestCheckFuncs to a single function.

* Add missing return statement.

* Fix IPV4 test

* Clarified comment.
2017-08-04 10:53:43 -07:00
Matt Morrison
0be42521c1 Fix error if container_node_pool deleted out of band (#293)
Prior to this change it was possible for Terraform to error during plan / apply with the following:
Error 404: The resource "node pool \"foo\" not found"
2017-08-04 10:24:53 -07:00
Riley Karson
0d02b116c7 Add Beta support & Beta feature ip_version to google_compute_global_forwarding_rule (#265)
* Add versioned Beta support to google_compute_global_forwarding_rule.

* Add Beta support for ip_version in google_compute_global_forwarding_rule.

* Temporary commit with compute_shared_operation.go changes.

* Added a test to see if v1 GFR is still IPV4, moved to a TestCheckFunc

* This API returns the original self links, but let's make sure we don't diff.
2017-08-04 10:15:51 -07:00
alex1x
8570849022 Add Support for Google source repos (#256) 2017-08-03 15:00:34 -07:00
Vincent Roseberry
ec21efb665 google_compute_instance reads scheduling fields from GCP. (#237) 2017-08-03 13:51:45 -07:00
Riley Karson
9f429e7ed2 Read from the zone set in state when possible in google_compute_autoscaler (#193) 2017-08-03 12:52:48 -07:00
Dana Hoffman
0afcb4d52c compute-component api has been replaced by compute, update tests (#276) 2017-08-03 10:58:58 -07:00
Riley Karson
3877b340e6 Add Beta support for auto_healing_policies to instance group manager. (#249)
* Add support for auto_healing_policies to google_compute_instance_group_manager.

* Add a test for self link stability when a v1 resource uses a versioned resource.

* Add a comment about what the stable self link test does.

* make fmt

* Fixed formatting on new tests.

* Address review comments.

* Fix make vet
2017-08-02 10:12:16 -07:00
Matt Morrison
0595ef25a5 Fix disk type’Malformed URL’ error (#275)
* Fix disk type’Malformed URL’ error

The API expects the disk type to be a SelfLink URL, but the disk type 
name was being used (e.g. “pd-ssd”).

* Add ACC Tests for boot disk type

* Fix acceptance test & fmt test config

The Instance data does not contain the actual disk type, just "PERSISTENT". This commit uses the computeClient to pull the disk data from the API, allowing checking of the disk type.

Also fmt'd the test configuration.
2017-08-01 15:39:32 -07:00
Dana Hoffman
947c18ec7a Persist state from the API for google_sql_database_instance regardless of what attributes the user has set (#208) 2017-08-01 13:13:09 -07:00
Joe Selman
c6ae260d63 Use a unique key when running project_metadata_item import tests (#274)
CI runs tests concurrently and will interfere with each other with the
current global key name.
2017-08-01 11:14:13 -07:00
Joe Selman
28f8931f0b Fix bug where startup-script metadata did not refresh (#180)
* Fix bug where startup-script metadata did not refresh

* Remove MetadataFormatSchema and replace with explicit filters/transforms
2017-08-01 10:47:58 -07:00
Dana Hoffman
32d7c3f62c Add support for legacyAbac to google_container_cluster (#261)
* revendor container api

* Add support for legacyAbac to `google_container_cluster`

* change to single enabled field
2017-07-31 11:09:05 -07:00
Aleksandr Didenko
1ec19cf3d9 Add support node config for GKE node pool (#184)
* Add support node config for GKE node pool

* Review fixes:
- Set max items in node config schema
- Fill missing node config fields
- Put test helpers above than test vars

* Update checks in node pool tests

* Fix node pool check match
2017-07-31 09:28:39 -07:00
Vincent Roseberry
53e481434e Add new data source: google_dns_managed_zone (#268) 2017-07-31 09:27:18 -07:00
Joe Selman
060861e678 Add an additional test with multiple project metadata items (#222)
This additional test would have caught the error fixed in
8f75c1c9a5
2017-07-28 15:50:12 -07:00
Joe Selman
88b1f092ff Fix issue with nondeterminism in tests (#226) 2017-07-28 12:59:19 -07:00
Paddy
37df58296b Merge pull request #171 from terraform-providers/paddy_iam
Add google_project_iam_binding and google_project_iam_member resources.
2017-07-28 12:22:33 -07:00
Joe Selman
50c10d4e7d Revert "Revert metadata item changes (#225)" (#257)
* Revert "Revert metadata item changes (#225)"

This reverts commit 884158d891.

* Use computeOperationWait instead of computeOperationWaitGlobal
2017-07-28 10:49:02 -07:00
Vincent Roseberry
3eaf4751db Add new resource google_compute_network_peering (#259) 2017-07-28 09:51:29 -07:00
Paddy
6f98217d66 Fix embarrassing typo in log message. 2017-07-27 14:37:39 -07:00
Paddy
d3426d5bc6 Don't set IDs in RMW loops.
We don't need to set the ID to "" in read-modify-write helpers, because
once they're done, we read anyways to update state based on the changes.
And that read checks if the binding/member still exists, and does the
SetId("") if it doesn't.

This way, we stick with state only getting set based on the API state,
not by what we think the state will be.
2017-07-27 14:29:25 -07:00
Paddy
ac5df40896 Return a type that was needed, rename a test function.
Tests need to have unique names. Whoooops.

Also, the Elem property accepts an interface I guess, which means we
actually need the struct type repetition there.
2017-07-27 14:11:52 -07:00
Paddy
f88e0429c7 Test adding multiple bindings at once. 2017-07-27 14:06:15 -07:00
Paddy
78545359bd Add logging statements, update : to / in IDs.
Update member IDs to use / instead of :.

Make sure we're logging any time we remove something from state.
2017-07-27 14:01:47 -07:00
Paddy
f94c3872af Switch to / as separator.
Switch to using / as a separator for IDs, instead of :.
2017-07-27 13:50:31 -07:00
Paddy
adc206a02d Add test case for updating to remove member.
Add a test case that updates a binding to remove a member.
2017-07-27 13:50:06 -07:00
Paddy
199ff5d1f1 Excise unnecessary type declarations.
Some struct types can be inferred instead of being repeated, so let's
take advantage of that.
2017-07-27 13:39:23 -07:00
Riley Karson
50069050c1 Removed the Compute Operation Wait Zone and migrated to universal wait. (#251)
* Removed the Compute Operation Wait Zone and migrated to universal wait.

* Removed unused var.
2017-07-27 08:48:25 -07:00
Riley Karson
01eecebac6 Remove the Compute Operation Wait Region methods, migrating to the universal wait. (#246) 2017-07-26 15:24:03 -07:00
Riley Karson
232cb87c7a Add versioned Beta support to google_compute_instance_group_manager (#234)
* Vendor GCP Compute Beta client library.

* Refactor resource_compute_instance_group_manager for multi version support (#129)

* Refactor resource_compute_instance_group_manager for multi version support.
* Minor changes based on review.
* Removed type-specific API version conversion functions.

* Add support for Beta operations.

* Add v0beta support to google_compute_instance_group_manager.

* Renamed Key to Feature, added comments & updated some parameter names.

* Fix code and tests for version finder to match fields that don't have a change.

* Store non-v1 resources' self links as v1 so that dependent single-version resources don't see diffs.

* Fix weird change to vendor.json from merge.

* Add a note that Convert loses ForceSendFields, fix failing test.

* Moved nil type to a switch case in compute_shared_operation.go.

* Move base api version declaration above schema.
2017-07-26 13:37:59 -07:00
Dana Hoffman
42a898dbd0 Add support for node pool autoscaling (#157)
* add node pool autoscaling

* docs for node pool autoscaling

* remove enabled attribute

* remove enabled from docs
2017-07-26 13:21:51 -07:00
Riley Karson
1f8254f260 Migrate all occurrences of WaitGlobal/WaitGlobal time to universal wait. (#243) 2017-07-26 09:40:06 -07:00
Vincent Roseberry
01ef451a94 Support import for google_compute_subnetwork (#227) 2017-07-26 09:30:59 -07:00
jimmy-btn
12ed8d8dd9 Update expected type of expiration time (#209) 2017-07-25 16:58:35 -07:00
Riley Karson
ec162c666c Refactor Compute Operations to work identically & introduce a scope-less API (#191)
* Refactor compute_operation.go to duplicate less code.

* Determine what scope type an Operation is from it's Operation object.

* Inlined operation type switch statement into if/else methods.
2017-07-25 16:22:27 -07:00
Paddy
775d931476 Merge pull request #6 from pdecat/f-google-storage-bucket-lifecycle
Add provider/google/google_storage_bucket lifecycle interface
2017-07-25 16:11:59 -07:00
Paddy
655435f940 Terraform fmt on our test configs. 2017-07-25 12:17:20 -07:00
Paddy
91d227cdb0 id => project_id
For clarity and explicitness(? is that a word?) use the project_id
instead of Terraform's internal id in our test configs.
2017-07-25 12:15:28 -07:00
Paddy
b0e3790b61 Use the policy r/m/w helper and handle edge case.
Use the new projectIamPolicyReadModifyWrite helper to manage the RMW
loop for our policy member resource.

Handle the case of having a binding server-side that doesn't have the
member we expect more elegantly.
2017-07-25 12:14:05 -07:00
Paddy
52d552d740 id => project_id in test configs.
Helps keep things explicit.
2017-07-25 12:00:03 -07:00
Paddy
f9eeb36657 terraform fmt test configs. 2017-07-25 11:56:27 -07:00
Paddy
5282ad7b12 Use string slice conversion helper. 2017-07-25 11:52:38 -07:00
Paddy
729e9fc501 Create an iam policy read/modify/write helper.
We were repeating that logic a lot, so this helper just reads a policy,
calls the passed modify function on the policy, then writes the policy
back and takes care of the optimistic concurrency logic for the caller.
So now all the caller has to do is the unique part, which is the modify
function.
2017-07-25 11:43:49 -07:00
Paddy
9c1c0bbc52 Just remove deleted bindings not present in the API.
We can just set the ID of bindings that are scheduled to be deleted but
don't exist in the API, we don't need an entire separate read request.
2017-07-25 11:12:15 -07:00
Paddy
d3f901bfc3 Refactor binding update loop for clarity.
Rewrite the structure of our if statement to make the conditions under
which each portion executes a bit more clear.
2017-07-25 11:08:34 -07:00
Dmitry Vlasov
63f76107a8 fix issue #218 2017-07-25 19:13:26 +03:00
Renaud Chaput
15ddd678e6 google_compute_ssl_certificate: mark private_key as sensitive (#220) 2017-07-24 16:24:36 -07:00
Dana Hoffman
884158d891 Revert metadata item changes (#225)
* Revert "Add additional fingerprint error to check for when updating metadata (#221)"

This reverts commit 4c8f62edf6.

* Revert "Fix bug where range variable is improperly dereferenced (#217)"

This reverts commit 8f75c1c9a5.

* Revert "Add support for google_compute_project_metadata_item (#176)"

This reverts commit 236c0f5d24.
2017-07-20 09:54:59 -07:00
Vincent Roseberry
076d31dd69 Support import for google_compute_instance_group (#201) 2017-07-20 09:21:18 -07:00
Joe Selman
4c8f62edf6 Add additional fingerprint error to check for when updating metadata (#221) 2017-07-19 15:33:07 -07:00
Vincent Roseberry
d9abcd8a9f Support path-only when referencing ssl certificate in compute_target_https_proxy (#210) 2017-07-19 13:49:14 -07:00
Joe Selman
8f75c1c9a5 Fix bug where range variable is improperly dereferenced (#217)
* Fix bug where range variable is improperly dereferenced

* Add comment explaining why a value is copied
2017-07-19 13:19:27 -07:00
Vincent Roseberry
f4db3fd1aa Support import for google_compute_https_health_check (#213) 2017-07-18 11:35:24 -07:00
Joe Selman
236c0f5d24 Add support for google_compute_project_metadata_item (#176)
* Add support for google_compute_project_metadata_item

This allows terraform users to manage single key/value items within the
project metadata map, rather than the entire map itself.

* Update CHANGELOG.md

* Add details about import
2017-07-17 16:28:51 -07:00