Commit Graph

759 Commits

Author SHA1 Message Date
Nathan McKinley
2ea356204f
Reduce flakiness by ensuring three successful fetches of IAM resources before returning. (#1197) 2018-03-15 11:15:42 -07:00
ishashchuk
14f1431896 Rolling update support for instance group manager (#1137) 2018-03-15 11:10:09 -07:00
Nathan McKinley
5bbc02c378
Add the organization iam policy, with suitable warnings. (#1196) 2018-03-14 15:21:33 -07:00
Dana Hoffman
65147fd23e
Add support for pod security policy (#1192)
* move setid calls back

* add support for pod security policy

* pod security policy docs

* Revert "move setid calls back"

This reverts commit 0c7b2dbf92aff33dac8c5beb95568c2bc86dd7de.

* cleanup

* remove comments about disabling update
2018-03-14 14:00:31 -07:00
Nathan McKinley
aaac3a1df9
Force validation of region for cloudfunctions. (#1188) 2018-03-13 12:11:41 -07:00
Dana Hoffman
99860f39e4
Dataproc autogen bucket changes (#1171)
* add extra wait for storage bucket object deletion

* make timeout for object deletion 5 minutes, make it succeed 3 times

* delete the cluster before deleting the bucket

* deprecate delete_autogen_bucket

* improve deprecation message
2018-03-13 11:46:27 -07:00
Dana Hoffman
fd0819786b
revive initial_node_count (#1176) 2018-03-13 11:45:01 -07:00
Benjamin Pineau
f65127585a Datasource for Backend Services (#1150)
Exposes existing `google_compute_backend_service` as data sources.
This addresses #149 .

This allows, for instance, to collect a backend service's self_link and
use it from an other workspace/tfstate, sharing most of the
loadbalancers definition.
2018-03-12 15:09:30 -07:00
ssaqua
9155a556ef Update to Cloud Functions Pub/Sub trigger event (#1180) 2018-03-12 14:55:55 -07:00
Dana Hoffman
9ae7a8ddb0
test fixes (#1185) 2018-03-12 13:18:39 -07:00
ishashchuk
2efa710696 Datasource for GCE service account (#1119)
* Data source for retrieving GCE service account
* Added project id for service account lookups (#15)
* Renaming attribute project_id -> project
2018-03-12 09:41:15 -07:00
Dana Hoffman
c33b33e1cc
expect 4 labels in dataproc cluster test (#1182) 2018-03-12 09:06:05 -07:00
Dana Hoffman
edf8918db6
Add generated resources for http(s)_health_check, updates to backend_bucket, and import helpers (#1177)
* add import helpers for generated code

* Updates to backend bucket and transport.go from MM

* add generated http(s)_health_check resources

* name is required; transport import style

* update docs with new fields/timeouts

* fixes
2018-03-09 17:14:32 -08:00
Toby Lawrence
08e81f528c Support distributionPolicy when creating regional instance group managers. (#1092)
* Support `distributionPolicy` when creating regional instance group managers.

* Better match the API structure of distributionPolicy.

* Switch to "distribution_policy_zones".

This approach lets us more simply allow a list of zones to use, while
providing a deprecation path for implementing the distribution policy
field more holistically, avoiding backwards-incompatible changes.

* fix typo

* use slice instead of Set for flattenDP
2018-03-09 11:04:09 -08:00
Dana Hoffman
1d1cfa64c4
increase timeout for dataproc test jobs completing (#1172) 2018-03-08 19:24:57 -08:00
Dana Hoffman
ab385ff574
don't set omitted fields when converting between a map and a struct (#1165) 2018-03-08 10:51:25 -08:00
Dana Hoffman
fc58b8e54c
Fix typo in pubsub iam test (#1169) 2018-03-08 09:16:50 -08:00
Dana Hoffman
46fb949c1f
Set ID for GKE resources before waiting (#1158) 2018-03-07 11:06:00 -08:00
Dana Hoffman
6d8a8b1747
Add more beta scaffolding for GKE resources (#1139)
* vendor container/v1beta1

* revendor container/v1beta1

* add beta scaffolding for gke resources

* fix json unmarshal error

* fix issues with trying to convert interface instead of struct

* same fixes but for node pool

* move setid calls back
2018-03-06 17:44:05 -08:00
Vincent Roseberry
91c9e0851c
Add IAM resources for pubsub subscriptions (#1156)
* Add IAM resources for pubsub subscription

* Add documentation

* Refactored topic and subscription computed methods

* Add project field to documentation

* Addressed Dana's comments
2018-03-06 09:52:39 -08:00
Paddy
9f47852189
Merge pull request #1141 from terraform-providers/paddy_863
Fix perpetual diff in #863.
2018-03-05 16:40:26 -08:00
Vincent Roseberry
35c2cb2abf
Add project field to iam pubsub topic resources (#1154)
* Add project field to iam pubsub topic resources

* Update documentation
2018-03-05 15:31:24 -08:00
Julien Phalip
3e4b66884b Let the compute zones data source accept a project parameter (#1122) 2018-03-05 13:32:14 -08:00
Florian Pfeiffer
6a2fca86a0 Loosen regex on projectId for importSpannerInstanceId and importSpannerDatabaseId (#1151) 2018-03-05 13:24:55 -08:00
Nathan McKinley
e8ffe89817
Extra error handling for node pools that don't match instance manager pattern. (#1149) 2018-03-02 17:14:48 -08:00
Florian Pfeiffer
5ea98d27f9 Loosen regex in computeDiskUserRegexString - accept ":" or "." (#1145) 2018-03-02 12:10:40 -08:00
Dana Hoffman
1d64cc5d26
allow importing a pubsub topic using its full id (#1142) 2018-03-02 11:22:58 -08:00
Dana Hoffman
263240dd9f
fix typos in pyspark dataproc job resource (#1120) 2018-03-01 18:02:33 -08:00
Genevieve
7e358d894a SQL DB Instance has attribute first_ip_address (#1050)
* Expose first ip address on sql db instance.

Signed-off-by: Desmond Pompa Alarcon Rawls <captaingrover@gmail.com>

* Use the ip_address key on the first map in ip_address list.

Signed-off-by: Genevieve LEsperance <glesperance@pivotal.io>

* Run first_ip_address test check if there is an ip address.

Signed-off-by: Desmond Pompa Alarcon Rawls <captaingrover@gmail.com>

* Add first_ip_address to sql db instance scheme.

Signed-off-by: Genevieve LEsperance <glesperance@pivotal.io>
2018-03-01 17:12:33 -08:00
Nathan McKinley
58a7ef9d03
Fix incorrect result on Read ignoring most authorized networks. (#1097) 2018-03-01 13:19:18 -08:00
Paddy Carver
61c1eb2719 Make RRdatas case insensitive.
The GCP backend apparently lowercases the values, no matter what you
enter, so we consider uppercase and lowercase values to be equivalent.
This fixes #862.
2018-03-01 13:01:30 -08:00
Paddy Carver
391516d741 Fix perpetual diff in #863.
This treats record set RRdata values as equivalent if they're quoted and
unquoted, as the GCP backend likes to return TXT records quoted.
2018-03-01 12:50:47 -08:00
ishashchuk
67ecf5345e Data source for retrieving project information (#1111)
* Project data source

* Mirroring project datasource from project resource (#14)
2018-02-28 12:37:24 -08:00
Dana Hoffman
313eb0fb89
Check set equality for service account scope changes (#1130)
* add debug printfs

* more logs for debugging

* check set equality for service acct scope changes

* revert changes to region igm

* style things
2018-02-27 14:29:00 -08:00
Dana Hoffman
919e7ee52f
Don't store disk id in state if it didn't create (#1129) 2018-02-26 11:13:20 -08:00
Darren Hague
5b0d8d43ff Allow specifying accelerators in cluster node_config (#1115) 2018-02-23 16:55:07 -08:00
Dana Hoffman
6d0b87ec1e
s/TestAccGoogle/TestAcc/ (#1121)
* s/TestAccGoogle/TestAcc/

* add back import

* reorder imports
2018-02-23 15:14:24 -08:00
Nathan McKinley
640e25931e
Move log statement for storage bucket (#1126) 2018-02-23 10:58:42 -08:00
Nathan McKinley
151e83aa26
Only check project if it's not present on the resource. (#1125) 2018-02-22 15:31:55 -08:00
Dana Hoffman
4154db93e9
add diffsuppress to allow lowercase ip protocols (#1118) 2018-02-22 09:27:43 -08:00
Dana Hoffman
9a4c92bb1b
add json omitted fields back when converting (#1098)
* add json omitted fields back when converting

* for testing: don't use json in convert

* try a combination of structs and mapstructure libraries

* Revert "try a combination of structs and mapstructure libraries"

This reverts commit eab11aa95d3abb74b240988e5c99d6e9525db96c.

* Revert "for testing: don't use json in convert"

This reverts commit 96af067b29dd147fcedb55995ebc8a17c6a9d1b2.
2018-02-22 09:27:02 -08:00
ishashchuk
ef3ea881b1 Datasource for retrieving GCS service account (#1110)
* Datasource for retrieving GCS service account

* Removing duplicated argument

* Gofmt post resolving conflicts

* Addressing review comment
2018-02-21 13:37:23 -08:00
Vincent Roseberry
304c0aa6cb
Move method out of resource file to prepare for autogen (#1102) 2018-02-20 12:40:02 -08:00
Vincent Roseberry
297b0a80e0
Refactor PubSub import test (#1106)
* Refactor pubsub subscription import test

* Refactor pubsub topic import test
2018-02-20 11:12:22 -08:00
Konstantinos Tsanaktsidis
411017c35f Fix overly restrictive validation for ServiceAccountLinkRegex (#1073) 2018-02-20 10:36:18 -08:00
Nathan McKinley
026e813287
Run gofmt. (#1095) 2018-02-15 19:26:36 -08:00
Vincent Roseberry
21564c36a1
Move method from resource to datasource file (#1093) 2018-02-15 15:40:40 -08:00
Dana Hoffman
7977d277ec
Add scaffolding to enable beta features in GKE resources (#1085)
* make api_versions more generic

* add api versions for gke
2018-02-15 18:37:36 -05:00
Vincent Roseberry
4b1fdee504
Changes to handle autogeneration. (#1087)
* Add Set method to TerraformResourceData and ResourceDataMock

* Add Id() and SetId() to ResourceDataMock and TerraformResourceData

* Keep only name when reading region or zone field to handle api that returns self_link
2018-02-15 15:32:31 -08:00
Julien Phalip
7477c7482c Let route resource accept "description" attribute (#1088) 2018-02-15 13:03:28 -08:00
Julien Phalip
c607b466f6 Fix VPN gateway data source schema for "network" attribute. (#1086) 2018-02-14 16:16:42 -08:00
Dana Hoffman
2e665f2f35
add support for updating alias ips in instances (#1084) 2018-02-14 15:48:47 -05:00
Nathan McKinley
f7851162a4
Don't set metadata_startup_script in some cases. (#1081) 2018-02-13 23:55:37 -08:00
Julien Phalip
1966a791a6 Add data source for forwarding rule (#1078) 2018-02-13 17:43:08 -08:00
Nathan McKinley
8354a43d1a
Add usage export bucket resource. (#1080) 2018-02-13 13:30:17 -08:00
Kit Ewbank
21e0075f6f Add 'google_folder_iam_binding' and 'google_folder_iam_member' resources (#1076) 2018-02-13 12:49:51 -08:00
Julien Phalip
509614e404 Improve error handling for data sources not found (#1077) 2018-02-13 11:19:59 -08:00
Julien Phalip
f6c5f01a95 Add VPN gateway data source (#1071) 2018-02-12 15:28:02 -08:00
Chase
e1323489ba Feature: select compute instance attached disk mode (#947) 2018-02-12 10:56:06 -08:00
Vincent Roseberry
5f32d7e87a
Fix TestAccContainerCluster_withIPAllocationPolicy test (#1065)
* Remove bad test in testAccContainerCluster_withIPAllocationPolicy

One step was expecting the test to fail if the subnetwork defines
secondary ip ranges that the cluster doesn't use. However, it is
perfectly fine to do so and we don't expect an error.

* Revert "Remove bad test in testAccContainerCluster_withIPAllocationPolicy"

This reverts commit af2f369907181a107cfc0ed9fa2ff0e288f02f66.

* Fail if use_ip_aliases is true and no range names is provided

* make fmt

* don't introduce new field for now. Wait until we want to support new feature in allocation policy
2018-02-09 13:55:38 -08:00
Vincent Roseberry
b789d7c2a0
Support multiple users with the same name for different host for 1st gen. (#1066)
* Support multiple users with the same name for different host for 1st gen.

* Fix typo and rename user
2018-02-09 13:43:49 -08:00
Dana Hoffman
9900e6a4c7
Add generated BackendBucket resource + transport.go (#1064)
* Add generated BackendBucket resource

* add ForceNew back to name

* Add log statements back
2018-02-08 17:58:20 -08:00
Vincent Roseberry
842256abc2
Return an error if name and name prefix are specified in node pool (#1062) 2018-02-08 13:35:35 -08:00
Vincent Roseberry
476fc5a945
Update master_auth password in cluster datasource test to meet the new minimal length requirement (#1063) 2018-02-08 10:16:51 -08:00
Vincent Roseberry
e8c5266a2f
Mark subnetwork field in container cluster as computed (#1061)
* Mark subnetwork field in container cluster as computed

* make fmt
2018-02-08 10:04:16 -08:00
Dana Hoffman
e48f247196
org policy test fixes (#1059) 2018-02-07 14:55:03 -08:00
Vaidas Jablonskis
1b042a3b18 Cloud SQL user password can be optional (#1056) 2018-02-07 11:59:23 -08:00
ishashchuk
7257b9aaa8 Storage Notification Resource (#1033)
* Storage Default Object ACL resource

* Fixed the doc

* Renamed the resource id. Log change

* Complying with go vet

* Changes for review

* link to default object acl docs in sidebar

* Support for GCS notifications

* docs for storage notification

* docs for storage notification

* Clarified the doc

* Doc modifications

* Addressing requested changes from review

* Addressing requested changes from review

* Using ImportStatePassthrough
2018-02-05 14:14:36 -08:00
Vincent Roseberry
388f9bcd79
Don't set MaxRate and MaxRateInstance (#1053)
* Don't set MaxRate and MaxRateInstance

* Fix if check
2018-02-05 12:58:11 -08:00
Vincent Roseberry
90b9fa1208
Remove master_auth from test that don't need it (#1049) 2018-02-05 11:15:03 -08:00
Emily Ye
41a0fddfbd remove multiple locks from cluster update and add lock helper 2018-02-05 09:45:53 -08:00
Vincent Roseberry
9d59f5f93a
Remove unnecessary Exists methods (#1032)
* Remove unnecessary
exists method

* make fmt

* Remove unused import
2018-02-02 13:04:22 -08:00
Dana Hoffman
cfac1dbc8b
deprecate compute_image.custom_timeout (#1038) 2018-02-02 10:56:18 -08:00
Vincent Roseberry
629c53be03
Make get(Region|Project|Zone) method testable (#1040) 2018-02-02 10:55:43 -08:00
Emily Ye
10ef26a905 actually fix container_network_policy diff suppress and add test 2018-02-01 10:25:12 -08:00
Emily Ye
5f3070e223 add diff suppress for empty network policy in container cluster 2018-01-31 14:36:03 -08:00
Vincent Roseberry
3a65e36cbc
Diff suppress unconventional public image family naming pattern (#1024)
* DiffSuppress for all public images family names

* Update documentation

* TF_ACC guard

* diskImageEquals should use ==
2018-01-31 09:33:26 -08:00
emily
d59f5fc3c1
Merge pull request #1028 from emilymye/capacity_scaler_1014
Force send numeric values if set for compute backend services
2018-01-30 17:13:36 -08:00
Emily Ye
24975fedd2 force send numeric values if set for compute backend services 2018-01-30 17:01:46 -08:00
Vincent Roseberry
559f28016f
Remove unnecessary StateFunc in compute_target_https_proxy (#1027)
* Remove unnecessary StateFunc in https proxy

* Support name only certificates

* Remove test for the removed validate func
2018-01-30 16:07:43 -08:00
emily
db3a88ebef
Merge pull request #1015 from jphalip/route-priority-optional
Make route priority optional, default to 1000
2018-01-30 15:20:03 -08:00
Dana Hoffman
3074db8084
keep description the same between updates 2018-01-30 14:41:20 -08:00
Jeff Johnson
d9a4be0c6c Remove Optional flag from Computed server_ca_cert resource (#1025)
Response to PR comment:
https://github.com/terraform-providers/terraform-provider-google/pull/1020#pullrequestreview-92660096
2018-01-30 14:37:30 -08:00
emily
f73db84c7e
Merge pull request #1019 from ewbankkit/issue-1018
Set 'project' attribute when importing 'google_logging_project_sink'
2018-01-30 13:32:59 -08:00
emily
7e91cbb05d
Merge pull request #1020 from johnsonj/master
Add support for Cloud SQL CA Cert (#635)
2018-01-30 13:19:37 -08:00
Vincent Roseberry
429c8e834c
Remove latest image from diskImageDiffSuppress (#1021) 2018-01-30 11:05:23 -08:00
Kit Ewbank
1f7e84c25e Call 'parseLoggingSinkId' to parse logging project sink ID. 2018-01-29 18:23:08 -05:00
Kit Ewbank
a51117ca97 Add back seperate logging project sink import test. 2018-01-29 18:22:15 -05:00
Jeff Johnson
6e101dd3b7 Add support for Cloud SQL CA Cert (#635)
Expose the 'ServerCaCert' object from the Cloud SQL Instance[1]

Related: #635 - Solves first point

[1] https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/instances#resource
2018-01-29 13:53:54 -08:00
Kit Ewbank
8748941116 Set 'project' attribute when importing 'google_logging_project_sink'. 2018-01-29 09:19:47 -05:00
Kit Ewbank
31bc09279d
Fix nil pointer dereference updating project labels. 2018-01-27 16:55:39 -05:00
Julien Phalip
261a43e633 Make route priority optional, default to 1000
Fixes #1009
2018-01-27 13:37:32 -08:00
ishashchuk
9f21b56fe5 Add google_storage_default_object_acl resource (#992)
* Storage Default Object ACL resource

* Fixed the doc

* Renamed the resource id. Log change

* Complying with go vet

* Changes for review

* link to default object acl docs in sidebar
2018-01-25 11:29:49 -08:00
Patrick Pelletier
eaac260f36 Add support for setting bucket's logging config (#946)
* Add support for setting bucket's logging config

* Add log_object_prefix and fix nil Logging condition
2018-01-25 11:02:08 -08: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
Simon Pizonka
fec2f0bc02 Add support for Google Cloud IoT Core registry (#970) 2018-01-24 13:03:09 -08:00
Dana Hoffman
c18ac00e8f
Add generic http client to Config struct (#994) 2018-01-24 13:00:53 -08:00
Kit Ewbank
b795a4563e Import google_compute_shared_vpc_host_project/google_compute_shared_vpc_service_project resources (#1004)
* Import google_compute_shared_vpc_host_project/google_compute_shared_vpc_service_project resources.

* Incorporate testing of resource import into main acceptance tests.
2018-01-24 12:54:42 -08:00
Dana Hoffman
3b753cefa2
Add update support for machine type, min cpu platform, and service accounts (#1005)
* Add update support for compute instance fields that require the machine to be stopped

* add warnings in docs about stopping the instance before updating

* add allow_stopping_for_update field
2018-01-24 12:50:39 -08:00
Lawrence Jones
9f42aeb652 PostgreSQL high availability (#1001)
* Update sqladmin api

Pull in updates to the generated sqladmin api and update callers for
the change in the StorageAutoResize setting

* Add support for availability_type setting

Allow specifying ZONAL or REGIONAL to allow for PostgreSQL HA
setup.

* vendor: update sqladmin/v1beta4

* Test setting AvailabilityType for PostgreSQL

Add tests that cover the creation of a Postgres database with
AvailabilityType set to REGIONAL, and correct some small issues that
were preventing compilation.

* Fix breaking change w/ disk_autoresize in cloudsql

95e5582766

The cloudsql admin client changed the way it handles StorageAutoResize
as a parameter, in order to be more explicit about when the server has
ommitted the field. This changed the type from being bool to *bool, and
we need to modify provider code so that we supply the right value to the
api client.
2018-01-24 09:23:48 -08:00
Dana Hoffman
33626a1e33
add metadata to gce cluster config in dataproc (#999) 2018-01-23 16:08:51 -08:00
Jacob Straszynski
939ba6d365 skip guest accelerators if count is 0. (#866)
* skip guest accelerators if count is 0.

Instances in instance groups in google will fail to provision, despite
requesting 0 GPUs. This came up for me when trying to provision
a similar instance group in all available regions, but only asking for
GPU's in those that support them by parameterizing the `count` and
setting it to 0.

This might be a violation of some terraform principles. For example,
testing locally with this change `terraform` did not recognize that
indeed my infra needed to be re-deployed (from it's pov, I assume it
believes this because inputs hadn't changed). Additionally, there may be
valid reasons for creating an instance template with 0 gpu's that can be
tuned upwards.

* Add guest accelerator skip test for instances.

* do not leave empty pointers to guest accelerators.

* attempt to clear guest accelerator diff

* conditionally customize diff for guest accels
2018-01-23 11:51:36 -08:00
Nathan McKinley
535fc64a14
condition.IsLive can come back nil - avoid crash if it does. (#997) 2018-01-22 14:14:02 -08:00
Nathan McKinley
0133845a19
Wrap HTTP errors so that concurrent-modification-detection works as designed. (#987) 2018-01-19 16:31:51 -08:00
Nathan McKinley
7b54aa8540
Read project name from API instead of inferring from provider in case of import. (#985) 2018-01-19 15:32:57 -08:00
Stefan Schmidt
bda219f276 Allow for legacy domain-scoped project IDs. (#960) 2018-01-19 15:11:30 -08:00
Vincent Roseberry
3e900a3e6b
Bump up defaults timeout for dataproc (#979) 2018-01-18 11:12:14 -08:00
Vincent Roseberry
5043f60939
Fix canonical image (#978) 2018-01-18 10:49:30 -08:00
Dana Hoffman
92b9984dae
fix gke tests (#977) 2018-01-18 09:51:55 -08:00
Nathan McKinley
d8aea17b19
New simple data sources for GCR Repo and Image. (#954)
New, very simple data sources for GCR Repo and Image, plus docs.
2018-01-17 18:47:25 -08:00
Vincent Roseberry
681cc72f38
Read compute instance boot disk initialization params from API (#948)
* read boot disk initialization param from API

* make fmt

* Mark the initialize_params list as computed to support boot source

* Ensure private family test follow naming pattern

* Improve docs
2018-01-17 13:23:24 -08:00
Vincent Roseberry
c9826b1452
Support subnetwork IP CIDR range expansion (#945)
* Vendor schema/helper/customdiff

* Support subnetwork IP CIDR range expansion

* Change wording
2018-01-17 12:58:37 -08:00
Vincent Roseberry
fc7c0ce74a
Add import support to google_dns_record_set (#895)
* Add import support to google_dns_record_set

* Add import test to NS record

* Minimize diff change

* Improve docs

* Make error message more helpful

* Add note about trailing dot at the end of the record name
2018-01-17 11:19:55 -08:00
Vincent Roseberry
d0f5fec463
Standardize resource name extraction from self_link/uri (#939)
* Standardize resource name extraction from self_link/uri

* remove rebase artifact

* style improvement

* Fix merge issue
2018-01-17 10:45:28 -08:00
Kit Ewbank
34279a6bde Correct usage of 'folders' for 'google_folder_organization_policy' resource. (#963) 2018-01-17 10:26:16 -08:00
Kit Ewbank
233485ba8a Fix 'go vet' error - 'arg found.AutoscalingPolicy.CpuUtilization.UtilizationTarget for printf verb %d of wrong type: float64'. (#969) 2018-01-17 09:52:20 -08:00
Nathan McKinley
719bbb40aa
Fix autoscaler - was unnecessarily forcing to a single metric (#966)
Fix for autoscalers - we were unnecessarily forcing to a single metric when multiple metrics are supported.
2018-01-16 17:10:13 -08:00
Nathan McKinley
ea50226ade
Add disable_on_destroy option to google_project_service. (#965) 2018-01-16 14:39:27 -08:00
James McGill
bc266979d4 Revert "Ensure Elem is always either a *Schema or *Resource (#929)" (#950)
This reverts commit a3352655ac.
2018-01-12 10:09:06 -08:00
Vincent Roseberry
3d178f5633
Fix update when changing health check type (#944) 2018-01-12 10:04:37 -08:00
Nathan McKinley
f50d4a19b4
New Resource: Dataflow Job (#855)
Add support for Google Dataflow jobs

Note: A dataflow job exists when it is in a nonterminal state, and does not exist if it
is in a terminal state (or a non-running state which can only transition into terminal
states).  See doc for more detail.
2018-01-10 14:38:15 -08:00
sarunask
f07c332849 Cloud functions (#899)
* Initial commit

* Adding google_cloudfunction_function resource

* Some FMT updates

* Working Cloud Function Create/Delete/Get
Create is limited to gs:// source now.

* Fixed tests import

* Terraform now is able to apply and destroy function

* Fully working Basic test

* Added:
1. Allowed region check
2. readTimeout helper

* Found better solution for conflicting values

* Adding description

* Adding full basic test

* dded Update functionality

* Made few more optional params

* Added test for Labels

* Added update tests

* Added storage_* members and made function source deploy from storage bucket object

* Adding comments

* Adding tests for PubSub

* Adding tests for Bucket

* Adding Data provider

* Fixing bug which allowed to miss error

* Amending Operation retrieval

* Fixing vet errors and vendoring cloudfunctions/v1

* Fixing according to comments

* Fixing according to comments round #2

* Fixing tabs to space

* Fixing tabs to space and some comments #3

* Re-done update to include labels in one update with others

* Adding back default values. In case of such scenario, when user creates function with some values for "timeout" or "available_memory_mb", and then disables those attributes. Terraform plan then gives:
No changes. Infrastructure is up-to-date.
This is an error. By adding const we would avoid this error.

* Fixed MixedCase and more tabs
2018-01-10 13:25:43 -08:00
Jonathan Pentecost
e3b6e3ea8c google/resource_source_repos_repository: Export repository url (#943)
* google/resource_source_repos_repository: Export repository url

* website/docs/r/sourcerepo_repository: Update official documentation link
2018-01-10 11:26:16 -08:00
Vincent Roseberry
3690926170
Support self_link from different project in dataproc network and subnetwork fields (#935) 2018-01-10 11:05:24 -08:00
Vincent Roseberry
4bd526a4f6
Deprecate the policy_data field of the google_service_account (#942) 2018-01-10 10:44:01 -08:00
Vincent Roseberry
da3a6f13a1
Infers region from zone before using the provider-level region (#938) 2018-01-09 13:57:02 -08:00
Vincent Roseberry
6ba6dfa6d2
Ensures operation on a cluster are applied serially (#937) 2018-01-09 12:39:04 -05:00
Dana Hoffman
585c734503
Set default scopes when creating GKE clusters/node pools (#924)
* set scopes by default

* clarify list -> list/set
2018-01-08 15:54:45 -08:00
Quinn Vallance
5a557546a7 Add google_logging_organization_sink resource (#923)
* Add google_logging_organization_sink resource

* cleanup
2018-01-08 18:15:30 -05:00
Piyush Mishra
de23b59463 Fix a typo in error message (#928) 2018-01-08 12:49:30 -08:00
James McGill
a3352655ac Ensure Elem is always either a *Schema or *Resource (#929)
* Ensure Elem is always either a *Schema or *Resource

* Revert vendor file
2018-01-08 12:48:26 -08:00
Vincent Roseberry
0252501cd4
Don't access attributes on a nil object (#918) 2018-01-04 16:17:03 -05:00
Dana Hoffman
5bf56797f7
make provider-wide region optional (#916) 2018-01-03 14:09:46 -08:00
Vincent Roseberry
dab491d28d
Make zone field consistent and truly optional for all resources (#914) 2018-01-03 16:18:40 -05:00
Vincent Roseberry
52462382c9
Refactor import tests for the remaining compute resources (#909)
* Improve instance group manager import tests

* Improe instance template & project metadata import test

* Improve region autoscaler import test

* Improve router interface import test

* Improve router peer import test

* Improve SSL certs import test

* Improve http & https target proxy import tests

* Improve target pool import test

* Improve url map import test

* Improve target ssl & tcp proxy import test

* Add import test for instance template disk
2018-01-03 09:26:55 -05:00
Vincent Roseberry
999ae08957
Fix flatten IAP and improve import test (#907) 2018-01-02 15:47:28 -05:00
Vincent Roseberry
d9f3e6b249
Add unit test for the self link diff suppress function (#904) 2018-01-02 14:21:04 -05:00
Vincent Roseberry
283c8f89e3
Delete unused methods (#905) 2018-01-02 14:15:13 -05:00
Michael Bannister
18534c9e7d Don't recreate container_cluster when maintenance_window changes (#893)
* Don't recreate container_cluster when maintenance_window changes

Fixes #727

* Omit ForceNew when false

Review comments for PR #893

* Move MaintenancePolicy mapping logic into expand/flatten functions

Review comments for PR #893

* Improve acceptance test for maintenance window update/removal

Review comments for PR #893
2017-12-27 12:29:14 -08:00
Vincent Roseberry
f15d66f28a
Remove noisy log statement (#896)
* Remove noisy log statement

* Remove unused import
2017-12-22 16:49:01 -08:00
Nick Jacques
46cc5b7d84 WIP: Add "internal IP only" support for Dataproc clusters (#837)
* Add internalIpOnly support for Dataproc clusters

* Add internal_ip_only to dataproc cluster docs

* Add default/basic dataproc internal ip test case

* Add test for dataproc internal_ip_only=true

* fixup cluster_config.gce_cluster_config to include .0.

* Remove redundant depends_on

* Add %s rnd to network and subnetwork

* Use variable for subnet CIDR and reference via source_ranges

* Add depends_on back to dataproc cluster test

* Fix cluster attribute refs (.0. again)
2017-12-22 13:24:05 -08:00
Kit Ewbank
49a0008643 Add 'google_organization' data source (#887)
* Add 'google_organization' data source.

* Use 'GetResourceNameFromSelfLink'.

* Remove 'resourcemanager_helpers'.

* Use 'ConflictsWith' in schema.

* Add 'organization' argument and make 'name' an output-only attribute.
2017-12-21 16:12:44 -08:00
Kit Ewbank
a086e70e79 Add 'google_billing_account' data source (#889)
* Add 'google_billing_account' data source.

* Use 'GetResourceNameFromSelfLink'.

* Use 'ConflictsWith' in schema.

* Use pagination for List() API call.

* Add ability to filter by 'open' attribute.

* Don't use 'ForceNew' for data sources.

* Add 'billing_account' argument and make 'name' an output-only attribute.

* Correct error message.
2017-12-21 16:09:58 -08:00
Vincent Roseberry
bded8d19ec
Better DiffSuppressFunc for disk image field (#884)
* Proper DiffSuppress for disk image field

* Add support for more possible image format
2017-12-21 10:00:35 -08:00
Dana Hoffman
f9f35bbe4a
more descriptive error message for health check not found (#883) 2017-12-20 13:22:48 -08:00
Matt Morrison
23ef50f5ca New datasource: google_container_cluster (#740)
* Add google_kubernetes_cluster datasource

Add documentation for google_kubernetes_cluster datasource

Rename datasource to google_container_cluster

To be consistent with the equivalent resource.

Rename datasource in docs.
google_kubernetes_cluster -> google_container_cluster.
Also add reference in google.erb file.

WIP

Datasource read needs to set an ID, then call resource read func

Add additional cluster attributes to datasource schema

* Generate datasource schema from resource

Datasource documentation also updated.

* add test for datasourceSchemaFromResourceSchema

* Code review changes
2017-12-20 13:21:11 -08:00
Vincent Roseberry
742462f9a6
Properly handle firewall direction field (#885) 2017-12-20 13:14:33 -08:00
Vincent Roseberry
502456a35d
Rename filename to match resource (#882)
* Rename filename to match resource

* Rename tests method
2017-12-20 10:48:43 -08:00
Vincent Roseberry
42cc44efe2
Add IAM support for pubsub topic (#875)
* Add IAM support for pubsub topic

* Fix resource name

* Add update test for iam_policy resource

* Standardize policy conversion function

* Standardize policy conversion function all resources
2017-12-19 17:19:04 -08:00
Vincent Roseberry
140440947a
Refactor some more import tests (#881) 2017-12-19 15:33:20 -08:00
Vincent Roseberry
b82949bdcd
Reduce number of new project creation (#880) 2017-12-19 14:40:24 -08:00
Vincent Roseberry
c1d9bb24c9
Support import in compute instance (#873) 2017-12-19 14:33:30 -08:00
Michael Parker
18a6255064 Adds google_kms_secret data source (#741)
* Create google_kms_secret datasource

* Create google_kms_secret datasource documentation

* Remove duplicated code

* Create acceptance test

* Fix indentation

* Add documentation to sidebar

* Update Cloud SDK link in docs

* Oxford comma

* Rename variable to make it clear which resource is under test

* Update test to use utils from provider_test
2017-12-19 13:24:35 -08:00
Vincent Roseberry
2e9933be44
Ignore beta vs v1 network diff in subnetwork datasource test (#849) 2017-12-19 13:08:14 -08:00
Vincent Roseberry
bc03e98998
Merge import test in regular acceptance tests for a few compute resources (#874) 2017-12-19 12:43:30 -08:00
Jonathan Liuti
e3bd6b9a1d Add configurable timeouts to subnetworks (#871) 2017-12-18 09:47:11 -08:00
Vincent Roseberry
b70803264f
Add service account IAM support (#840)
* Add service account iam resources
* Add documentation
* Add import functionality to iam resources
* Add import documentation
2017-12-14 14:52:44 -08:00
Vincent Roseberry
293728929f
Add update support for routing mode in google_compute_network (#857)
* Fetch latest compute v1 client

* Add update support for rounting in google_compute_network
2017-12-14 14:28:58 -08:00
Nathan McKinley
d2611d4ce3
New data source: compute region instance group (#851)
* Add new data source: compute region instance group manager's groups.
* Add documentation for wait_for_instances and for the timeout mechanism in resourceComputeRegionInstanceGroupManagerCreate.
2017-12-14 13:35:39 -08:00
Vincent Roseberry
d2289c2ca1
Add configurable timeouts to google_compute_instance (#856) 2017-12-13 17:03:15 -08:00
Vincent Roseberry
433fdcc49f
Storage bucket doesn't remove lifecycle rules properly (#850)
* Update storage client

* Read lifecycle from API and improve acceptance tests
2017-12-13 16:46:48 -08:00
Vincent Roseberry
5585b14069
Import test refactoring for some resources. (#854)
* Improve import tests for folder, org iam custom roles and org policies

* improve import test for google project
2017-12-13 16:45:52 -08:00
Vincent Roseberry
982f4d1c0b
Fix storage object detect md5 hash for dynamic content (#848) 2017-12-13 16:41:07 -08:00
Nathan McKinley
bea8642a1b
Bugfix: add read back in to the KMS crypto key read method. (#853)
* Bugfix: add read back in to the KMS crypto key read method.
Impact of this bug: if a user deleted a crypto key outside terraform and then reran `apply`, the old key would stay in the plan.

* Fix panic in validate method.
* Make import test confirm validity of reads.
2017-12-13 13:08:35 -08:00
Michael Parker
606103afb6 Add support for compute network routing mode (#838)
* Add ability to specify compute network routing mode
* Update docs
2017-12-12 11:29:49 -08:00
Nathan McKinley
5766f2b107
Remove all instances of GOOGLE_XPN_HOST_PROJECT environment variable. (#815)
Remove all instances of GOOGLE_XPN_HOST_PROJECT environment variable.

Instead of GOOGLE_XPN_HOST_PROJECT being required to run some tests, I added the ability to create and tear down the necessary project structure.
This allows us to remove one environment variable, and use two others which are already widely-required: org and billing ID.
2017-12-11 14:07:52 -08:00
Nathan McKinley
ced8cb506c
Consistent IAM resource imports. (#835)
Add consistency for for IAM imports.
- Adds imports for projects, folders, crypto keys, organizations, and key rings.
- Anything else with IAM can implement a simple method and begin working immediately.
- Add tests for all the IAM imports.
- Import documentation for IAM resources.
2017-12-11 10:24:53 -08:00
Paddy
792fa311c7
Merge pull request #832 from terraform-providers/paddy_creds_file_or_path
Fix our provider validation to allow file paths.
2017-12-08 14:28:46 -08:00
Paddy
f5a835141d
Merge pull request #833 from terraform-providers/paddy_compute_image_ds
Add compute image data source
2017-12-08 14:11:47 -08:00
Paddy
f18607b849 Fix our provider validation to allow file paths.
Previously, provider credentials were _supposed_ to be able to be
specified as the file contents or the path to the file. We even had a
test for the code for this!

Then we updated the validation for the provider, and forgot to validate
filepaths as ok. So provider validation failed. And because our test
only tested the config validation, and not the provider validation, our
tests thought this was just fine still.

This fixes that oversight, accepting filepaths as valid. It also adds
tests to ensure that provider validation allows both file paths and
contents.
2017-12-08 13:57:55 -08:00
koenw
4da0e984f6 Implement in-place updates of secondary IP ranges (#811) 2017-12-08 13:11:09 -08:00
Vincent Roseberry
b88561b44f
Robust id parsing for big query table (#828) 2017-12-08 11:13:53 -08:00
Vincent Roseberry
3bceb8f951
Add IAM support for storage bucket (#822)
* Add IAM support for storage bucket
* Add documentation
* Test multiple roles
2017-12-07 13:12:25 -08:00
Vincent Roseberry
a2b3666551
Rename kms iam test file (#827) 2017-12-06 14:39:29 -08:00
Nathan McKinley
114b646fae
Enable 'zone' to be specified at the provider level instead of per-resource. (#816)
- Fetch Zone attribute any place where it *was* being fetched from the schema by
	combination schema / provider-level attribute.
- Allow region to be unspecified if zone is specified.
- Switch one example to using provider-level zone as an example.
- Make provider-level zone optional.  (Individual resources will fail if they can't find a zone.)
- Add tests for getZone and getRegion.
2017-12-06 14:30:04 -08:00
Vincent Roseberry
9bebdd02f5
Make network name unique between each test run (#826)
* Make network name unique between each test run

* make fmt
2017-12-06 12:36:00 -08:00
Paddy
04fb54a8fc I'm on a roll.
How do program.
2017-12-06 12:01:30 -08:00
Paddy
f717f878e7 Actually check if an instance is running.
Forgot the most important part of the fix!
2017-12-06 11:59:45 -08:00
Paddy
4f9687e457 Fix the database sweeper.
It's getting hung up on a database replica instance that's not running,
so it can't stop it.

To resolve, we're only trying to stop replica instances that are in a
running state. Also, I noticed a bug that we'd try to delete replicas
twice, so I fixed that, as well.
2017-12-06 11:56:17 -08:00
Vincent Roseberry
d4e297ec44
Add google_kms_key_ring_iam_policy resource and improve iam docs (#814)
* Add google_kms_key_ring_iam_policy resource and improve iam docs
* Delete iam_binding and iam_member specific doc page for key ring
2017-12-06 09:33:21 -08:00
thomas jouannic
af3dcfde4c Include the "compute_image" datasource in the provider 2017-12-05 00:09:20 +01:00
thomas jouannic
81bb36333e Add tests for the "compute_image" datasource 2017-12-05 00:09:20 +01:00
thomas jouannic
95597bf022 Add the "compute_image" datasource 2017-12-04 23:43:17 +01:00
Vincent Roseberry
12baa8766b
Add support for min_cpu_platform to instance_template (#808)
* Add support for min_cpu_platform to instance_template

* Set value in initializer

* Extract test min cpu platform value in a const
2017-12-01 12:03:19 -08:00
Paddy
400a764f38 Clean up silly variable use. 2017-11-29 17:17:33 -08:00
Paddy
bb8725e513 Only handle root NS records special.
We introduced special handling for NS records in 1.2.0 under the
assumption that ALL NS records can't be deleted. This isn't actually
true. Only NS records for the naked domain of the managed zone can't be
removed; all other NS records can be. Because of this, 1.2.0 contains a
bug where all NS records are removed.

This update fixes the situation to only use special handling on NS
records that are for the naked root domain of the managed zone, and
treat all subdomain NS records as normal records. It also adds a test to
ensure this functionality.

Fixes #729.
2017-11-29 16:21:01 -08:00
Paddy
645dfa473e
Merge pull request #805 from terraform-providers/paddy_legacy_ipv4
Unremove ipv4_range on networks.
2017-11-29 15:51:41 -08:00
Dana Hoffman
0ef0367273
give disk_autoresize a default (#806) 2017-11-29 15:51:00 -08:00
Paddy
c9fb64ed57 Unremove ipv4_range on networks.
We removed ipv4_range, but the API still exists, it's just deprecated.
This breaks configs for users that haven't migrated off yet. I added it
back, added some tests to use it, included it in the docs, and basically
tried to put things back the way they were. The main difference now is
that the auto_create_subnetworks field defaults to true, and we want to
keep that behaviour to avoid a breaking change. So now if users want to
use the lagacy API, they need to set auto_create_subnetworks to false
explicitly.
2017-11-29 15:03:36 -08:00
Vincent Roseberry
8f701c6ebb
Remove getNetworkName method and use ParseNetworkFieldValue instead (#802) 2017-11-29 10:54:10 -08:00
Konrad Rotkiewicz
2f1b3a739c add empty value for ip version for global address (#799) 2017-11-29 10:07:40 -08:00
Vincent Roseberry
c812b83fa7
Detect changes to local file or changes made outside of Terraform to the file stored on the server. (#798)
* Detect changes to local file or changes made outside of Terraform to the file stored on the server.
* Add comment about why the detect_md5hash field is optional and not computed
2017-11-29 10:03:03 -08:00
Dana Hoffman
50afa7b199
compute instance helpers / metadata cleanup (#797)
* get rid of getSubnetworkLink and getProjectAndRegionFromSubnetworkLink

* dedupe metadata flatteners

* update flattenMetadata comment
2017-11-29 09:47:42 -08:00
Vincent Roseberry
1ee386b33b
Fix service_account_id field validation in service account key (#795) 2017-11-28 14:37:46 -08:00
Nic Cope
94a405d179 Add Alias IP and Guest Accelerator support to Instance Templates (#639)
* Move AliasIpRange helpers into utils

To reflect the fact they'll be used by multiple resources.

* Pass Config to build helpers, not meta

It's the only thing meta is used for.

* Refactor getNetwork util methods to return early for the happy path.

* Update compute APIs

compute.Instance.MinCpuPlatform is now GA.

* Fix panic in TestComputeInstanceMigrateState

This seemed to be a pre-existing issue, i.e. I could repro it in master.

--- FAIL: TestComputeInstanceMigrateState (0.00s)
panic: interface conversion: interface {} is nil, not *google.Config [recovered]
        panic: interface conversion: interface {} is nil, not *google.Config

goroutine 85 [running]:
testing.tRunner.func1(0xc4205d60f0)
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:711 +0x2d2
panic(0x203acc0, 0xc4205d2080)
        /usr/local/Cellar/go/1.9.1/libexec/src/runtime/panic.go:491 +0x283
github.com/terraform-providers/terraform-provider-google/google.migrateStateV3toV4(0xc4205f2000, 0x0, 0x0, 0x0, 0x48, 0xc4205f2000)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:182 +0x2405
github.com/terraform-providers/terraform-provider-google/google.resourceComputeInstanceMigrateState(0x2, 0xc4205f2000, 0x0, 0x0, 0x0, 0x0, 0xe0000000000)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:48 +0x21a
github.com/terraform-providers/terraform-provider-google/google.runInstanceMigrateTest(0xc4205d60f0, 0x2260816, 0x8, 0x227d23a, 0x20, 0x2, 0xc4205ec0f0, 0xc4205ec120, 0x0,
 0x0)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:803 +0xc1
github.com/terraform-providers/terraform-provider-google/google.TestComputeInstanceMigrateState(0xc4205d60f0)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:71 +0xc84
testing.tRunner(0xc4205d60f0, 0x22d81c0)
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:789 +0x2de
FAIL    github.com/terraform-providers/terraform-provider-google/google 0.035s

* Use only the v1 API for resource_compute_instance

Alias IP ranges, Accelerators, and min CPU platform are now GA.

* Move common instance code into utils.go

Methods used by both resource_compute_instance and
resource_compute_instance_template are currently spread between their respective
files, and utils.go.

This commit moves them all into utils.go for the sake of consistency. It may be
worth considering an instance_common.go file or similar.

* Unify compute_instance and compute_instance_template network_interface and service_account code

This has the side effect of enabling Alias IP range support for
compute_instance_templates.

* Add tests for compute instance template Alias IP ranges

* Mark instance template region as computed

We compute it from the subnet its network interfaces are in. Note this
is not new behaviour - I believe it was erroneously missing the computed
flag.

* Support guest accelerators for instance templates

Since most of the code is already there.

* Add a test for using 'address' rather than 'network_ip' for instance templates

* Don't mark assigned_nat_ip as deprecated

* Remove network_interface schema fields that don't make sense for a compute instance template

* Add newline after count in instance template docs

* Don't try to dedupe guest accelerator expansion code

The API calls to Google to create guest accelerators take different values
for instances and instance templates. Instance templates don't have a zone
and can thus *only* be passed a guest accelerator name.

* Use ParseNetworkFieldValue instead of getNetworkLink

* Add support for parsing regional fields, and subnetworks specifically

Currently unused because subnetworks may have a separate project from that
of the instance using them, which complicates looking up the project field.

* Fall back to provider region when parsing regional field values

Also slightly refactors getXFromSchema field helper functions for readability.

* Revert to assigned_nat_ip in compute instance docs

* Add beta scaffolding to compute instance and compute instance template

Note these resources don't currently use beta features - this is futureproofing.

* Fix indentation in comment about instance template alias IP ranges

* Consolidate metadata helper functions in metadata.go

* Move compute instance (and template) related helpers into their own file
2017-11-28 10:01:27 -08:00
Vincent Roseberry
d4c5a718a5
Validate account_id length in google_service_account (#793)
* Add validation method for RFC1035 names
2017-11-27 17:58:11 -08:00
Vincent Roseberry
6c5d6b72e0
Store project and region in state (#784)
* Store project and region in state

* Delete unused project in runtimeconfig_variable
2017-11-27 16:32:20 -08:00
Vincent Roseberry
9930daa2af
Always use a function to create a test config (#785) 2017-11-27 16:32:00 -08:00
Vincent Roseberry
a9fd5fddcb
Detect changes to cloud storage object when using source field. (#789)
* Detect server or local changes to bucket object when using source field

* Improve tests by removing global err and tf vars

* Address Dana's comments
2017-11-27 16:25:32 -08:00
David Quarles
d57db91143 add support for ip aliasing in google_container_cluster (#654)
* add support for ip aliasing in `google_container_cluster`

* [review] cleanup galore, infer feature enablement from `ip_allocation_policy`

* [review] cleanup, round 2

* add nil check back (when reading ip allocation policy from API)
2017-11-27 18:15:03 -05:00
Vincent Roseberry
10f764aa9b
Add new resource google_folder_organization_policy (#747)
* Add new resource google_folder_organization_policy
* Add documentation
2017-11-27 14:53:01 -08:00
Sébastien GLON
39f22ef924 [WIP] Add container cluster network policy addon (#630)
* replalce TypeList by TypeSet

* Add network policy

* test improvement

* correct test

* Add cluster network polocy enabled

* Replalce network_policy addons by global network_policy enabled

* Update node_config.go

* Update resource_container_cluster.go

* clean

* clean

* Correct PR

* COrrect PR

* pr

* fix test to use same name

* add more documentation
2017-11-27 15:40:07 -05:00
Vincent Roseberry
40c20047b1
Revert "Added support for updating a cloud storage object using source field (#362)" (#787)
This reverts commit 5ba87f3d9e.
2017-11-24 11:10:58 -08:00
Rodrigue Cloutier
5ba87f3d9e Added support for updating a cloud storage object using source field (#362) 2017-11-24 10:25:53 -08:00
James Turley
6f4a7926ba IAM resources for KMS KeyRIng and CryptoKey (#781)
* Add IAM bindings and member resources for KMS KeyRings

* Add IAM bindings and member resources for KMS CryptoKeys

* Docs for key ring and crypto key IAM resources

* Exctract KMS policy conversions to helper functions

* Split iam_binding and iam_member tests for KMS

* Docs for kms IAM member resources

* Run KMS IAM tests in own project
2017-11-23 11:26:43 -08:00
James McGill
ca545e2171 Set UseLegacySql to true for compatibility with the BigQuery API (#724)
* Set UseLegacySql to true for compatibility with the BigQuery API

* make gofmt happy
2017-11-21 15:06:59 -08:00
Vincent Roseberry
ac0948e7d6
Refactored authoritative IAM policy logic to be reusable (#776) 2017-11-21 14:58:02 -08:00
Vincent Roseberry
e70d1fc44b
Add IAM binding and member support for organizations (#775) 2017-11-21 14:30:48 -08:00
Vincent Roseberry
fdfa9a5eb0
Fix Iam Binding to not rely on project specific code (#774) 2017-11-21 13:00:05 -08:00
David Quarles
34297fe478 Add support for google_container_node_pool management (#669)
* add support for `google_container_node_pool` management (sans-tests)

* [review] add tests, docs, general cleanup

* add docs

* [review] amend test to check updates and terraform fmt

* test updates, make nested management fields non-computed
2017-11-21 12:56:29 -08:00
Vincent Roseberry
0c0caee7ba
Standardize on test env var for region, creds and project (#770) 2017-11-21 09:34:32 -08:00
Nicki Watt
68f7d775c3 Add google_dataproc_job resource (#253)
* Add google_dataproc_job resource

* Correct state ref in docs

* make tests parallel

* cleanup, mostly whitespace related

* docs fmt
2017-11-21 09:32:43 -08:00
Vincent Roseberry
1859c558fe
Refactor project iam binding and member resources to improve reusability (#744)
* Refactor project iam binding and member resources to improve reusability
* Use default mask when updating project iam policy
* Add a doc comment for the ResourceIamUpdater interface
2017-11-20 17:01:39 -08:00
Vincent Roseberry
3a945770e5
Get test org and billing account in a consistent way (#766) 2017-11-20 15:45:51 -08:00
Vincent Roseberry
454384fc70
All beta fields in compute firewall are GA (#768)
* Upgrade compute v1 client
* Upgrade gensupport
* Use v1 API now that all beta features are in GA for `google_compute_firewall`
2017-11-20 15:38:47 -08:00
thomas
8ee14c4424 Add the "google_compute_global_address" datasource (#759)
* Add the "compute_global_address" datasource

* Add a basic test for the "compute_global_address" datasource

* Include the "compute_global_address" in the provider

* Add docs for the "compute_global_address" datasource
2017-11-17 11:22:37 -08:00
thomas
ecdb1de297 the XPN_* env. variable is no longer mandatory (#760)
Since this variable is only used for 3 tests, it doesn't make sense
to declare it as mandatory in the test config. Therefore, concerned tests
are now skipped if the variable is absent.
2017-11-17 10:32:46 -08:00
Vincent Roseberry
aa63af1fc3
Add documentation for import in google_folder_organization_policy (#746)
* Remove import support for org policy

* Add ForceNew to org_id field

* Revert "Remove import support for org policy"

This reverts commit f65d9fb347d6b0998be55ef823c5726e876c53ae.

* Add import documentation for google_organization_policy
2017-11-17 09:24:48 -08:00
Johannes Brüderl
7a9582ac00 allow node pools with size 0 (#752) 2017-11-16 17:38:42 -08:00
Dana Hoffman
451b9cb6b6
fix target pool import test (#755) 2017-11-16 15:07:14 -08:00
Vincent Roseberry
5bcd7cb921
Push expiration time values in acc test farther in the future (#754) 2017-11-16 11:01:05 -08:00
Dana Hoffman
8fa1178814
compare next hop by self link (#753) 2017-11-16 10:53:49 -08:00
Dana Hoffman
b7177e04c8
Delete encryptor-pod.yml (#749)
Somehow this snuck in to #692 but it doesn't look like it's actually used anywhere.
2017-11-16 09:50:58 -08:00
thomas
06140c553a Add the "google_compute_address" datasource (#748)
* Add the "compute_address" datasource

* Add a basic test for the "compute_address" datasource

* Include the "compute_address" datasource in the provider

* Add the documentation for the "compute_address" datasource
2017-11-16 09:16:52 -08:00
Norberto Lopes
5a261e0cff Add folder data source (#738) 2017-11-15 13:14:03 -08:00
Andrew Farrell
56d633a8d4 Adds support for creating KMS CryptoKeys resources (#692)
* Adds support for creating KMS CryptoKeys resources

* Destroy extant CryptoKeyVersions on CryptoKey destroy

* Inherit project, location etc from KeyRing in CryptoKey

* Add function to calculate next rotation

* Implement RotationPeriod parameter on CryptoKey

* Import CryptoKey state

* Uncommit my local acceptance test hacks

* Docs for google_kms_crypto_key

* Clear id at the end of CryptoKey deletion

Also add more detail to warning message.

* Fix parseCryptoKeyId error messages

* Use correct naming in CryptoKeyIdParsing test

* Check RotationPeriod is present in acceptance test

* Rename variable in test function for consistency

* Fix wrong resource name in cryptokey docs

* Add KeyRing to CryptoKey doc example

* Run test CryptoKey configs through terraform fmt

* Don't set CryptoKey purpose in terraform state on import

* Fix indentation in CryptoKey test

* Parallelise CryptoKey tests

* Set rotation_key on CryptoKey read

* Move RotationPeriod validation to planning phase

* Use import state passthrough for CryptoKey

* Correct casing issues in test case names

* Remove redundant CheckDestroy calls in CryptoKey tests

* Add explanatory comment about extra test steps

* More explicit error handling in CryptoKey tests

* Explicit dependency on project services in test keyring configs

* Clean up comments in cryptokey resource

* Do not repeat in cryptokey id regexes
2017-11-14 13:21:25 -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
Vincent Roseberry
108971f261
Add new resource to support IAM custom organization roles (#735)
* Add new resource to support IAM custom organization roles
* Add documentation
2017-11-13 16:05:16 -08:00
Vincent Roseberry
a6378fc3d4
Add import support for google_compute_backend_bucket (#736)
* Add import support for google_compute_backend_bucket
* Improve docs for consistency
2017-11-13 15:59:34 -08:00
Vincent Roseberry
6adbdcfaee
Change authorized_networks to set (#733) 2017-11-13 12:51:15 -08:00
Michael Bannister
ee641e0b1f Relax diff on maintenance_policy.daily_maintenance_window.start_time (#726)
* Relax diff on maintenance_policy.daily_maintenance_window.start_time

If the maintenance window has been set outside of Terraform to a time with a
single-digit hour (such as 1:00), and the terraform definition is set to the
same hour but with a leading zero as per validation (i.e. 01:00), do not
consider the time to be changed (as we currently don't support update on this
property).

Fixes #719

* Generalise rfc3339TimeDiffSuppress and add more test cases
2017-11-13 11:30:26 -08:00
Vincent Roseberry
ab68b06af5
Add new resource to support IAM custom project roles. (#709)
* Upgrade iam client to latest version
* Add new resource to support IAM custom roles.
* Add documentation
2017-11-10 11:01:33 -08:00
Vincent Roseberry
5aa9f574ea
Properly handle diff in google_compute_route next_hop_instance field (#716) 2017-11-10 10:57:53 -08:00
Dana Hoffman
b5faecd585
Add configurable timeouts for disks (#717)
* add configurable timeouts for disks

* add test for disk timeout
2017-11-10 10:21:14 -08:00
Konrad Rotkiewicz
a7c8d0469a Add import support for ssl certificate, http/s proxy and url map (#678) 2017-11-09 10:16:57 -08:00
Vincent Roseberry
bd30b25a8f
Serialize org policy boolean tests to avoid flakiness when tests are run in parallel (#708) 2017-11-08 11:29:04 -08:00
Paddy
f4b7ca7cbe Fix commented out test.
Because of weirdness in our test runner, our CI tries to run every test
that matches the TestAcc* prefix, _even if it's commented out_. This
leads to failed tests in CI for tests that aren't even running, which is
annoying.

This PR just lowercases the first letter of the test so it doesn't match
the prefix anymore and the CI won't try to run it.
2017-11-08 10:58:30 -08:00
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