Commit Graph

267 Commits

Author SHA1 Message Date
Steven Normore 320ee053c3 doks: add node pool auto-scale fields (#307)
* doks: add auto_scale, min_nodes, max_nodes, and actual_node_count to node pool

* doks: add more auto-scaling node pool test coverage

* doks: documentation for auto-scaling node pools

* Handle case where a node pool is empty.

* Bump testClusterVersion to 1.15.5-do.0
2019-10-30 18:39:39 -04:00
Kennardy Dewanto 8ace5c43d6 Add data source for sizes (with filter and sort) (#325)
* Implement basic schema for digitalocean_sizes data source

* Implement basic read for digitalocean_sizes data source

* Implement exact match filter and sort for digitalocean_sizes data source

* Update documentation

* Gardening: Add missing sidebar_current in the /d/sizes markdown

* Change sort schema to use List type (since order should matter when applying multiple sort)

* Rework sorting sizes to be able to handle multiple sorts in defined order
2019-10-30 17:46:48 -04:00
Kennardy Dewanto 6a2eb3e6d0 Add resource for database (#327)
* Add resource for database

* Rename digitalocean_database to digitalocean_database_db

* Fix copy-paste typo in import database user test comment
2019-10-29 14:39:47 -04:00
Kennardy Dewanto 62c5f89da5 Add resource for database user (#328)
* Add resource for database user

* Use new syntax in example.
2019-10-28 18:57:37 -04:00
Kennardy Dewanto 0ed5cdb884 Add data source for account (#324)
* Add datasource_digitalocean_account

* Add website page for datasource_digitalocean_account

* Gardening: Add missing sidebar_current in the /d/account markdown
2019-10-28 17:39:22 -04:00
Poh Zi How cb610c9ad0 Add support for spaces CORS (#322)
* add support for spaces CORS

* Ensure CORS rules are set on bucket creation.

* Add test case for multiple CORS rules.

* Add to CORS to docs.
2019-10-22 19:10:12 -04:00
Paul Stack 655147c103 Upgrade to terraform-plugin-sdk (#321)
* Upgrade to terraform-plugin-sdk

After following the [guide](https://www.terraform.io/docs/extend/plugin-sdk.html#using-tf-sdk-migrator)

Check

```
▶ GO111MODULE=on tf-sdk-migrator check
Checking Go runtime version ...
Go version 1.12.10: OK.
Checking whether provider uses Go modules...
Go modules in use: OK.
Checking version of github.com/hashicorp/terraform-plugin-sdk to determine if provider was already migrated...
Checking version of github.com/hashicorp/terraform used in provider...
Terraform version 0.12.8: OK.
Checking whether provider uses deprecated SDK packages or identifiers...
No imports of deprecated SDK packages or identifiers: OK.

All constraints satisfied. Provider can be migrated to the new SDK.
```

Migrate

```
▶ GO111MODULE=on tf-sdk-migrator migrate
Checking Go runtime version ...
Go version 1.12.10: OK.
Checking whether provider uses Go modules...
Go modules in use: OK.
Checking version of github.com/hashicorp/terraform-plugin-sdk to determine if provider was already migrated...
Checking version of github.com/hashicorp/terraform used in provider...
Terraform version 0.12.8: OK.
Checking whether provider uses deprecated SDK packages or identifiers...
No imports of deprecated SDK packages or identifiers: OK.

All constraints satisfied. Provider can be migrated to the new SDK.

Rewriting provider go.mod file...
Rewriting SDK package imports...
Running `go mod tidy`...
Success! Provider is migrated to github.com/hashicorp/terraform-plugin-sdk v1.1.0.

It looks like this provider vendors dependencies. Don't forget to run `go mod vendor`.
Make sure to review all changes and run all tests.
```

* Fix build under go 1.13.x.
2019-10-22 17:44:03 -04:00
Andrew Starr-Bochicchio 9cc70a3bda
doks: Produce a valid kubeconfig file. (#315)
* doks: Produce a valid kubeconfig file.

* doks: Re-add cluster_ca_certificate to example.

* Revert change to go.mod

* Make client-key-data and client-certificate-data omitempty.

* doks: Re-add cluster_ca_certificate to example in datasource as well.
2019-10-08 18:32:46 -04:00
Steven Normore 0b606c4e68 doks: fetch new kubeconfig credentials only when expired (#311)
* Upgrade godo to v1.22.0

* doks: fetch new kubeconfig credentials only when expired
2019-10-08 11:32:24 -04:00
Steven Normore 356fd5c157 doks: bump version in tests to 1.15.4-do.0 (#312) 2019-10-08 10:14:44 -04:00
Steven Normore 2454bb055e doks: bump to latest cluster version and use token auth (#309)
* doks: bump versions to latest 1.15.3-do.3

* doks: fix acc tests to use auth token instead of certs

* doks: update docs to mention token auth in the kube config
2019-10-07 13:00:56 -04:00
Steven Normore 980fd9a853 doks: fix acc tests (#308)
* doks: run testacc in parallel

* doks: use alpha-prefixed random cluster and node pool names in tests

* doks: wait for node pool count in tests

* Use 'tf-acc-test-' for test resource prefix.
2019-10-07 12:07:49 -04:00
Andrew Starr-Bochicchio 7247363eec
Expose private connection info for replicas and mark final DBaaS fields sensitive (#302)
* datasource/database_cluster: Add password to exported attributes and mark fields sensitive.

* resource/database_replica: Expose private connection info and mark fields sensitive.
2019-10-03 10:09:44 -04:00
Srinidhi Kaushik 345cb24393 Mark uri, private_uri, password as sensitive for database_cluster. (#301) 2019-10-01 13:18:56 -04:00
Srinidhi Kaushik 4fb11473b5 Provide private connection details for `database_cluster' (#300)
* Add `private_{host,uri}' for datasource and resource.

* Update test cases.

* Fix var name.

* Update related docs.
2019-10-01 10:51:22 -04:00
Andrew Starr-Bochicchio a77f1e52c4
terraform.VersionString() has been deprecated. (#295) 2019-09-26 11:00:32 -04:00
Daniel Ramteke e8548f42fd Find a droplet by tag (#290)
* find a droplet by tag

* fixed a bug where it was comparing only the first tag

* Add acceptance test.

* Tidy vendor folder.

* Small tweak to docs.
2019-09-25 15:54:23 -04:00
Boris Popovschi e9abfbc2f1 Added DatabaseReplica resource support (#294)
* Added DatabaseReplica resource support

* Fix PR comments

* Added ForceNew for region and size fields

* Added docs, added tags

* made tags field ForceNew

* Check computed attribtures in test.

* Allow importing database replicas.
2019-09-24 20:38:17 -04:00
Boris Popovschi 8fa087d44f Added Tags support for database cluster (#293) 2019-09-20 18:59:09 -04:00
Alex Pilon 39f87daae8
remove usage of config pkg
update tf sdk to v0.12.8
2019-09-06 22:20:39 -04:00
Jonathan Hartman f7b97cb7e8
Mark the kubernetes_cluster resource's kube_config field as sensitive
This data includes sensitive information about the cluster, such as its private
key. This prevents that data from ending up in, for example, logs on a CI system
that does a `terraform plan` as part of its build.

With this applied, a `terraform plan` or `terraform apply` instead shows:

```
...
        ipv4_address   = "1.2.3.4"
        kube_config    = (sensitive value)
        name           = "roboticcheese"
...
```

Also updates the acceptance tests, as 1.14.4-do.0 is no longer available.
2019-08-31 12:16:51 -07:00
Andrew Starr-Bochicchio c8455d585f
Merge pull request #284 from terraform-providers/asb/issues/283
Verify Droplet is destroyed before removing from state (Fixes: #283).
2019-08-27 11:11:21 -04:00
Andrew Starr-Bochicchio 15fbc03daa digitalocean_database_cluster: version should not be required (Fixes: #285, #287). 2019-08-22 11:44:25 -04:00
Andrew Starr-Bochicchio fbfabff8fc Include 'off' as a valid starting status. 2019-08-21 17:23:12 -04:00
Andrew Starr-Bochicchio 42cfcf74d8 Verify Droplet is destroyed before removing from state (Fixes: #283). 2019-08-21 11:57:58 -04:00
petems 5c8fedbc1a Adds created_at attribute for droplets
Fixes #277
2019-08-08 13:06:55 +01:00
Andrew Starr-Bochicchio 0250fccd12 Consistently protect against nil response in error handling (Fixes: #272). 2019-07-23 12:11:05 -04:00
Andrew Starr-Bochicchio 73b5d5f87a
Merge pull request #271 from veracus/fix/update-kubernetes-cluter-version
Update digitalocean_kubernetes_cluster version
2019-07-23 11:05:17 -04:00
Jackson Sadowski 2c024ad05a Update Kubernetes cluster version 2019-07-22 20:33:03 -04:00
Andrew Starr-Bochicchio 3f5ac117dc Run 'make fmt' to make 'make test' happy. 2019-07-22 16:06:31 -04:00
stack72 0f65b2c4e0 Update database Cluster to set URN 2019-07-20 08:55:57 -05:00
Andrew Starr-Bochicchio e14dc51ce0 Support enabling and disabling backups on Droplets (Fixes: #266). 2019-07-11 15:22:53 -04:00
Andrew Starr-Bochicchio a6ae33d62f Add test for enabling and disabling backups on a Droplet. 2019-07-11 15:05:20 -04:00
Andrew Starr-Bochicchio 03d737389f Make CI happy by running gofmt. 2019-07-10 17:44:28 -04:00
stack72 4002a2b630 provider: Add the ability to set DIGITALOCEAN_ACCESS_TOKEN
Fixes: #260

This follows the same usage as `doctl` so not having to reset env
vars would be a better experience. This DOT NOT remove DIGITALOCEAN_TOKEN,
this just adds the ability to specify one of the two and the
provider will continue to work as expected
2019-07-04 12:27:24 +03:00
Andrew Starr-Bochicchio fafe544d10
Merge pull request #262 from terraform-providers/asb/issue/184
K8s: Do not filter out node pool tags also applied to the cluster (Fixes: #184).
2019-07-03 14:02:54 -04:00
Andrew Starr-Bochicchio 08c7646403 Add tests for filterTags function. 2019-07-03 12:30:49 -04:00
Andrew Starr-Bochicchio 51961debcc Remove now unused tagsContain function. 2019-07-02 11:15:11 -04:00
Andrew Starr-Bochicchio 3057d43f99
Merge pull request #251 from stack72/stack72/database-cluster-datasource
datasource: New Database Cluster Datasource
2019-06-10 18:05:50 -04:00
stack72 6e9422d8ae resource/droplet: Removing the IPv6 private parameter
Fixes: #181

DigitalOcean doesn't support IPv6 private networking. Therefore,
having a parameter in the schema for this isn't correct. It has
been marked as `removed` with an appropriate error message
2019-06-10 02:24:35 +03:00
stack72 4105b97c1b datasource: New Database Cluster Datasource
Fixes: #236

```
▶ acctests digitalocean TestAccDataSourceDigitalOceanDatabaseCluster_Basic
=== RUN   TestAccDataSourceDigitalOceanDatabaseCluster_Basic
--- PASS: TestAccDataSourceDigitalOceanDatabaseCluster_Basic (343.56s)
PASS
ok  	github.com/terraform-providers/terraform-provider-digitalocean/digitalocean	343.609s
```
2019-06-10 02:23:05 +03:00
Andrew Starr-Bochicchio 3551052e93 K8s: Do not filter out node pool tags also applied to the cluster (Fixes: #184)
While still in beta, the DigitalOcean Kubernetes API automatically applied tags
from the cluster to the node pools. The provider's `filterTags` function
accounted for this by not manually applying tags found on the parent cluster
to the children node pools:
```
// we need to filter tags to remove any automatically added to avoid state problems,
// these are tags starting with "k8s:", named "k8s" or duplicates of the cluster tags
```

This does not match the current behavior of the API. See:

https://github.com/terraform-providers/terraform-provider-digitalocean/issues/184

The updated test fails without the additional changes:
```
$ make testacc TESTARGS='-run=TestAccDigitalOceanKubernetesCluster_Basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDigitalOceanKubernetesCluster_Basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-digitalocean	[no test files]
=== RUN   TestAccDigitalOceanKubernetesCluster_Basic
--- FAIL: TestAccDigitalOceanKubernetesCluster_Basic (211.95s)
    testing.go:538: Step 0 error: Check failed: 3 errors occurred:
        	* Check 9/30 error: digitalocean_kubernetes_cluster.foobar: Attribute 'tags.#' expected "2", got "3"
        	* Check 18/30 error: digitalocean_kubernetes_cluster.foobar: Attribute 'node_pool.0.tags.#' expected "2", got "1"
        	* Check 19/30 error: digitalocean_kubernetes_cluster.foobar: Attribute 'node_pool.0.tags.2053932785' not found

FAIL
FAIL	github.com/terraform-providers/terraform-provider-digitalocean/digitalocean	211.957s
GNUmakefile:18: recipe for target 'testacc' failed
make: *** [testacc] Error 1
```

And passes with them:
```
$ make testacc TESTARGS='-run=TestAccDigitalOceanKubernetesCluster_Basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDigitalOceanKubernetesCluster_Basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-digitalocean	[no test files]
=== RUN   TestAccDigitalOceanKubernetesCluster_Basic
--- PASS: TestAccDigitalOceanKubernetesCluster_Basic (242.73s)
PASS
ok  	github.com/terraform-providers/terraform-provider-digitalocean/digitalocean	242.736s
```
2019-06-06 16:51:01 -04:00
Andrew Starr-Bochicchio 74b6e23f92 Update K8s test to excersise issue #184. 2019-06-06 16:51:01 -04:00
Andrew Starr-Bochicchio 517e5be154 kubeconfig should be TypeList not TypeSet (Fixes: #239). 2019-05-24 11:51:45 -04:00
Andrew Starr-Bochicchio 896d377ca8 Add integration test with Kubernetes provider. 2019-05-24 11:50:52 -04:00
Andrew Starr-Bochicchio b28255c9fa
Merge pull request #232 from terraform-providers/asb/import-improvements
Various resource import improvements (Fixes: #231).
2019-05-15 12:11:52 -04:00
Andrew Starr-Bochicchio 8ce6fb4b32
Add context to comment in resourceDigitalOceanDropletRead about image slugs. 2019-05-13 15:34:09 -04:00
Andrew Starr-Bochicchio fdc2ea8537 Make Droplet importing more robust and test error case when importing non-existent resource. 2019-05-10 15:57:03 -04:00
Andrew Starr-Bochicchio f03e5252c3 Simplify Spaces bucket importing and test error case when importing non-existent resource. 2019-05-10 15:55:41 -04:00
Andrew Starr-Bochicchio 6b3a641ed9 Remove need for custom import function for Volume resources. 2019-05-10 15:54:14 -04:00